unhandled exception in unknown module

G

Guest

In a VB .NET app, I am dynamically changing a form's menu. While stress
testing the code in the IDE, I got intermittent exceptions thrown: "An
unhandled exception of type 'System.NullReferenceException' occurred in
Unknown Module". In the debugger, I click on Break and get "There is no
source code available for the current location".

There have been posts in these newsgroups about unhandled exceptions of
various kinds in unknown code. One post suggested SP1 for framework 1.1 was
the problem, and that is what I am running. (FYI, I'm using XP Pro 5.1 SP2
Build 2600, and I'm not calling Application.EnableVisualStyles.) Also, I'm
aware of the chinese characters issue, and that is not my problem. Also, my
problem occurs only in the IDE - my stress tests run fine when I run the exe
outside the IDE (debug version both in IDE and standalone exe).

So, these are my questions:
1. Does MS acknowledge a problem in this area?
2. Is there a consensus view of the state of this problem?
All responses are welcome, but before posting a flip response to #2, please
review previous related postings. Search MSDN Newsgroups for "unhandled
exception unknown module".

Finally, I think I could create a small size .NET VB app that exhibits the
problem, but it would take some effort. Maybe responses to this posting will
make the effort unnecessary.
 
G

Guest

Here is a trivially small illustration of the problem.
1. Create a new VB Windows Application Project
2. Add a KeyPress event
3. Paste the body of the KeyPress event below into your KeyPress event
handler
4. Run the program in the IDE
5. Hit m, repeat at beep, a few repeats may be needed to raise an exception
6. Run the exe standalone outside the IDE, and no exceptions will be thrown.

The problem is intermittent, and that is why there is a for loop.
I know this code is pointless - I whittled down some working code to get the
smallest possible illustration of the problem.

My KeyPress event handler follows:

Private Sub Form1_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress
' illustrate the 'unhandled exception in unknown module' problem
' in the ide, hit m, at beep repeat until an exception is thrown
' execution outside the ide does not throw any exceptions
Select Case e.KeyChar
Case "m"
Dim mm As MainMenu
For i As Integer = 1 To 1000 ' the problem is intermittent
mm = New MainMenu
Next
Beep()
End Select
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top