Troubleshoot using a .NET application that does not start

I have a recurring problem with .NET applications that do not start (on other systems than mine). The fact is that, unfortunately, I cannot always create a smooth package. Therefore, I often have to send a ZIP file to my Debug or Release folder.

My real problem is that these applications do not say WHY they do not start. I just do not get any exception if I run them from the command line, either in EventLog, or even if I try to print the result of the Try Catch block in my entire application ... did I miss something?

In most cases, there are no libraries or security issues. But it would be nice to find what exactly is going on painlessly: D

+6
debugging
source share
4 answers

Have you tried watching merge magazines? Suzanne Cook has an article about it here .

Another thing to do (to minimize errors): minimize your Main method; the reason is that JIT works in one method, and if it cannot JIT Main , it cannot use exception handling:

 /* for winform, you still new [STAThread] here */ static void Main() { try { MainCore(); } catch (Exception ex) { // shout about it } } [MethodImpl(MethodImplOptions.NoInlining)] // usually overkill static void MainCore() { // real code } 
+3
source share

Take a look at the Log Viewer Assembly Window .

+3
source share

I had a problem due to which WPF applications did not start - it turns out that the problem is with fonts on the user's PC - disabling the WindowsPresentationFontCache service fixed the problem.

I also found a message elsewhere with the following information ...

... for some unknown reason, the client had invalid entries in the registry keys that are used to create this cache of the default font family specified in the stack trace. The customer was asked to export the entries to HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ Fonts and send the file to me. There were several font file names strangely starting with a dash (---). They were fixed and a registry file was sent back to the client for import. After that, the application started successfully!

You may also need to delete the font cache according to the instructions in this link http://support.microsoft.com/kb/937135

+1
source share

I know that this does not address the problem directly - but have you tried publishing your application (assuming you use Visual Studio, of course)? This should wrap everything you need into the installer.

0
source share

All Articles