BUG: You receive an unrecoverable compiler error if you reference the ListManager property (316511)



The information in this article applies to:

  • Microsoft Visual Basic 2005 Express Edition
  • Microsoft Visual Basic .NET (2003)
  • Microsoft Visual Basic .NET (2002)

This article was previously published under Q316511

SYMPTOMS

If the instance of the CurrencyManager is accessed and assigned to a variable directly through the ListManager property of the DataGrid control in Microsoft Visual Basic .NET, you receive the following error message:
Visual Basic .NET compiler is unable to recover from the following error: Internal compiler error: code generator received malformed input. Save your work and restart Visual Studio .NET.
After you receive this error message, commentate out from the code or modify the line that caused this error message, save your project, and then quit and restart Microsoft Visual Studio .NET.

Note In Microsoft Visual Studio 2005, you may receive the following error message:
error BC30390: 'System.Windows.Forms.DataGrid.Protected Property ListManager() As System.Windows.Forms.CurrencyManager' is not accessible in this context because it is 'Protected'.

CAUSE

This problem occurs because the DataGrid control contains a member that generates a naming conflict with the ListManager property.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

The ListManager property of the DataGrid control is a protected member, and therefore cannot be accessed directly. The protected ListManager property exposes the CurrencyManager class for the DataGrid control. As it is a protected member of the DataGrid control, you cannot assign this property directly to a variable in your Visual Basic .NET project. If you try to assign this property, you receive the error message mentioned in the "Symptoms" section and you must restart Visual Studio .NET.

Steps to Reproduce the Problem

NOTE: The following code is only for demonstration and it should not be compiled at all.
  1. Start Visual Studio .NET or Visual Studio 2005, and then create a new Windows Application project.
  2. On the Project menu, add a new module (Module1) to the project.
  3. Add the following code to the module:
    Public Module Module1
        Sub Main()
            Dim DGrid As New DataGrid()
            Dim CurManager As CurrencyManager = DGrid.ListManager
        End Sub
    End Module
     
    					
  4. Edit the line of code that defines the CurManager variable. For example, remove and then add back the equal sign (=) character.

Modification Type:MajorLast Reviewed:2/23/2006
Keywords:kbvs2005applies kbvs2005swept kbvs2002sp1sweep kbbug kberrmsg kbnofix KB316511