How to check crash issue in C# apps ?

Recently I was working on a C# application. Suddenly someone asks “Are you able to remove all the dll in bin folder”.

The one thing that splashes in my mind was Jetbrain Resharper. It can be used to Remove the Library Reference that is not used in the app.  I go ahead and do. The reference is gone but bin still has the dll.

Next thing I did is remove every dll from the bin folder. After running the app it’s crashing. The VS is not showing any good error or crash exception. Earlier I was in a situation when  I want to figure out what is going wrong. What I do is getting detail from Event Manager. Event Manager record issues from the app. The crash is recorded as RED. This was very useful things on windows to let us know what is going wrong with our app, Even we can only see UI part.

This time I go to Exception Windows and checked Win32 App and Common Language Runtime error. So If you have worked on C#, You can see that some dll depends on other dll. So My app was doing 1 or 2 things. Half of dll I resolved using restore from Recycle Bin. And Other half dl I solved using running UI once or 2 times. Problem solved. Now my project has only that dll that used in my app.

Similarly, in 2016 I was working on a software which is a bundle of 6-8 software.  Things going terribly wrong when version mismatch of NewtonSoft.JSON. One project has a reference to a newer version of JSON.NET  and one the oldest one. All 6 software compile and it’s bin goes to one folder which installed on the user system.

If the project that is compiled last have newer or older, in both case software have mismatch issues. This means it will break other software. The one thing you can do is redirect the assembly from .exe.config. In Visual Studio when you compile your ABC it makes abc.exe you have abc.config in your bin folder. You can use assembly redirect, it will work.

This was my experience, I still love to play with c# and all things come around my work. If you have a similar experience. Please share. Even you spent hours to make a small thing fixed on ASP.NET MVC Server or deploy a c# application it’s great fun.

Thanks for reading my post. I hope you enjoyed it.

Leave a Reply

Your email address will not be published. Required fields are marked *