Microsoft KB Archive/819349

= BUG: You may receive a &quot;Visual Basic internal compiler error&quot; 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.



Steps to Reproduce the Problem
 In Visual Studio .NET, start a new console application by using Visual Basic .NET.

By default, Module1 is created. Add the following code to the Main procedure in Module1:  Dim a As Integer 'Add a handler to the event of the array. AddHandler a.e, AddressOf Main RemoveHandler a.e, AddressOf Main  On the Build menu, click Build Solution. 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. On the Build menu, click Cancel to end the compilation.</li> Close the IDE. You may receive the error message in the &quot;Symptoms&quot; section.</li></ol>

<div class="references_section">