View Single Post
Old 19th August 2008, 01:54   #46  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
Quote:
I have another app with the same error message, and the author have no clue as to what could be wrong.
There were two problems, one causing a exception and another one not catching possible exceptions. Just tell him to change the region to norway in the windows control panel, then he can reproduce the crash. Following code was crashing:

Code:
CultureInfoValue = New CultureInfo(CultureInfo.CurrentCulture.TwoLetterISOLanguageName)
On a exception .NET applications normally show a own exception dialog or at least the .NET exception dialog is shown so it's easy to track the problem. In case there is a unhandled exception in the constructor of the startup form however, the .NET exception dialog is not shown but only the crash dialog of the operating system giving no hints what the problem is. The solution for this adding a try catch block in the constructor to handle possible exceptions or to use the event AppDomain.UnhandledException to handle anything unhandled, the event Application.ThreadException won't work in this case!

Since I've improved exception handling in the latest beta I'm hoping future crashs will always show more then just the useless crash dialog of the operating system.
stax76 is offline   Reply With Quote