Microsoft KB Archive/819349

From BetaArchive Wiki
Knowledge Base


BUG: You may receive a "Visual Basic internal compiler error" error message when you use the ADDHANDLER statement or the REMOVEHANDLER statement in Visual Studio .NET

Article ID: 819349

Article Last Modified on 5/16/2007



APPLIES TO

  • Microsoft Visual Basic .NET 2002 Standard Edition
  • Microsoft Visual Basic .NET 2003 Standard Edition




SYMPTOMS

You can pass an array as a base reference to the event in the ADDHANDLER statement or in the REMOVEHANDLER statement in your application. However, when you try to compile your application, the compiler stops responding instead of displaying compilation errors. When you close the Microsoft Visual Studio .NET IDE, you may receive the following error message:

Visual Basic .NET compiler is unable to recover from the following error: System Error &Hc0000005&(Visual Basic internal compiler error)
Save your work and restart Visual Studio .NET.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION


Steps to Reproduce the Problem

  1. In Visual Studio .NET, start a new console application by using Visual Basic .NET.

    By default, Module1 is created.
  2. Add the following code to the Main procedure in Module1:
  3.  Dim a() As Integer
    'Add a handler to the event of the array.
    AddHandler a.e, AddressOf Main
    RemoveHandler a.e, AddressOf Main
  4. On the Build menu, click Build Solution.
  5. In the Output window, you can see the following message:

    Performing main compilation



    However, the compilation is not completed. The compiler stops responding and does not show the errors in the code.
  6. On the Build menu, click Cancel to end the compilation.
  7. Close the IDE. You may receive the error message in the "Symptoms" section.


REFERENCES

For more information about events and event handlers, visit the following Microsoft Web site:

http://msdn2.microsoft.com/en-us/library/2z7x8ys3(vs.71).aspx


Keywords: kbvs2005swept kbvs2005doesnotapply kbvs2002sp1sweep kbpending kbproperties kbevent kbcompiler kbbug KB819349