My relatively simple Window Application seems to crash as soon as it gets to the InitializeComponent method in the form’s constructor. Now the form is obviously a partial class and InitializeComponent is call to the method in the other part of the partial class.
Problem is that other partial class is generated. How do I go about debugging it and finding out which line is causing my app to crash. The application crashes with an error report dialog with very sparse details of the error. I cant debug the app through the IDE because the application only crashes on the deployment machine and loading vs2008 on that machine is out of the question. Please help.
My relatively simple Window Application seems to crash as soon as it gets to
Share
Without more details it will be difficult to give you any specific suggestions.
You might add an event handler to the application ThreadException to catch any unhandled exceptions. In the event handler I would log the exception, stacktrace, and any other relevant data you might have. If you are not using a logging framework of some kind then you can always use what’s available in the System.Diagnostics namespace (and the necessary additions to your app.config) in order to add some simple log output handling.
The other thought I have is are you using non-MS provided UI libraries? If so, are they included with your application/installer. Assuming your app uses some and they aren’t included this could be the reason why it crashed in the InitializeComponent call.
Update:
Based upon your comments I’ve updated my answer. You can add code to the InitializeComponent method, just keep in mind it’s generated code so editing it does pose some risk. Dumb question but have you checked to make sure the constructor is even being called? The fact that it’s crashing the way you describe is typically an indicator that something fundamental to the app is missing/configured incorrectly on the target machine. You might also check the Windows Event Log on that machine to see if anything useful was entered there for you.