Reputation: 388
I'm having the following error when closing a form in an application
See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.
***** Exception Text *******
System.NullReferenceException: Object reference not set to an instance of an object. at Infragistics.Win.UltraWinGrid.UltraCombo.get_Text() at Infragistics.Win.UltraWinGrid.UltraCombo.OnEnter(EventArgs e) at System.Windows.Forms.Control.NotifyEnter() at System.Windows.Forms.ContainerControl.UpdateFocusedControl()
I'm almost sure that this has something to do with the fact that I'm using multithreading to populate some data, but my problem is that I'm not able to determine the place in which the call to the method is being made. A .Net framework appears and I can only click continue or close, but what I really wanted was an application crash to determine what is causing the error. This is even more complicated because it only happens with compiled code. Do you know any profiler or technic to catch the error? Can I attach the debugger to my exe to capture the method throwing the error?
UPDATE: What I really want is to enable JIT debugging and have access to the stacktrace tho determine the cause of the error, I've done that by adding the
<system.windows.forms jitDebugging="true" />
to the config file as described in MSDN to my config file, but now I'm not getting any error at all. Bottom like, can I do anything else for the framework give additional details about the error?
Upvotes: 1
Views: 506
Reputation: 2791
You can set Visual Studio up to break on specific types of exceptions. There is an Exceptions dialog under the Debug menu. Just check the exception you wish to break on and run the code with the Visual Studio Debugger attached.
Upvotes: 2