Microsoft KB Archive/927511

= FIX: Visual Studio 2005 may exit unexpectedly when you import a generic type in a Visual Basic 2005 application, and an interface member may be reimplemented incorrectly when you compile a Visual Basic 2005 application =

Article ID: 927511

Article Last Modified on 12/3/2007

-

APPLIES TO


 * Microsoft .NET Framework 2.0
 * Microsoft Visual Studio 2005 Team System Test Edition
 * Microsoft Visual Studio 2005 Team Edition for Software Architects
 * Microsoft Visual Studio 2005 Team Edition for Software Developers
 * Microsoft Visual Studio 2005 Team Edition for Software Testers
 * Microsoft Visual Studio 2005 Standard Edition
 * Microsoft Visual Studio 2005 Professional Edition
 * Microsoft Visual Studio 2005 Express Edition

-



Important This article contains information about how to modify the registry. Make sure that you back up the registry before you modify it. Make sure that you know how to restore the registry if a problem occurs. For more information about how to back up, restore, and modify the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows registry



For users who have Microsoft Visual Studio 2005 Service Pack 1 installed
Visual Studio 2005 Service Pack 1 (SP1) is now available for download. This service pack includes all the Microsoft Visual Basic 2005 hotfixes that have been created to date. Visual Studio 2005 SP1 provides you the best overall performance and stability when you are developing in Visual Basic 2005.

For more information about Visual Studio 2005 SP1, visit the following Microsoft Developer Network (MSDN) Web site:

http://msdn2.microsoft.com/en-us/vstudio/bb265237.aspx

The hotfix that is described in this article provides the same improvements for the Visual Basic 2005 command-line compiler (Vbc.exe) that are included with Visual Studio 2005 SP1. If you have Visual Studio 2005 SP1 installed, and if one of the following conditions is true, you must apply only the .NET Framework 2.0 hotfix that is included with this hotfix package:
 * You are developing Web sites by using Microsoft ASP.NET 2.0.
 * You are building solutions outside the Visual Studio 2005 IDE by using the Visual Basic 2005 command-line compiler.

You must apply this hotfix on both development computers and deployment computers to obtain the Visual Studio 2005 SP1 fixes for the Visual Basic 2005 command-line compiler. For more information, see the &quot;File information&quot; section.

For users who do not have Visual Studio 2005 SP1 installed
If you do not have Visual Studio 2005 SP1 installed, and you are experiencing the symptoms that are described in this article, you must apply both the hotfixes that are included in this hotfix package. For more information, see the &quot;File information&quot; section.



SYMPTOMS
In Visual Studio 2005, you may experience the following problems.

Problem 1
When you import a generic type in a Visual Basic 2005 application, Visual Studio 2005 may exit unexpectedly (crash). Additionally, you may receive the following error message:

Microsoft Visual Basic Compiler has encountered a problem and needs to close. We are sorry for the inconvenience.

Problem 2
Under some special conditions, an interface member may be reimplemented incorrectly when you recompile a Visual Basic 2005 application.



Service pack information
To resolve this problem, obtain the latest service pack for Visual Studio 2005. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

929697 How to obtain the latest Visual Studio 2005 service pack

Hotfix information
A supported hotfix is now available from Microsoft. But the hotfix is intended only to correct the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Visual Studio 2005 service pack that contains this hotfix. To resolve this problem immediately, visit the following Microsoft Web site:

http://go.microsoft.com/fwlink/?linkid=87457

Prerequisites
You must have the Microsoft .NET Framework 2.0 and Visual Studio 2005 installed to apply this hotfix.

Restart requirement
You do not have to restart the computer after you apply this hotfix.

Hotfix replacement information
This hotfix replaces the hotfixes that are described in the following Microsoft Knowledge Base articles:

915038 FIX: You may receive Visual Basic compiler error messages when you are developing a Visual Basic 2005 project in Visual Studio 2005

917452 FIX: You may experience performance issues when you use solutions that contain large Visual Basic projects in Visual Studio 2005

919904 FIX: You may receive an error message when you try to build a Web project that references a .NET Compact Framework 2.0 assembly in Visual Basic 2005

920145 FIX: You may receive an error message when you consume an assembly that has an obfuscated generic type in Visual Studio 2005

920805 FIX: You may experience slow performance when you work with a Visual Basic solution that contains many projects in Visual Studio 2005

924162 FIX: The Visual Basic 2005 compiler unexpectedly exits when you expand an item in the Visual Studio 2005 Watch window after you install the hotfix from KB article 920805

926405 FIX: The Visual Basic 2005 compiler unexpectedly exits when you work with a Visual Basic 2005-based project in Visual Studio 2005

926970 FIX: You may experience a performance problem when you debug a Visual Basic 2005 application in Visual Studio 2005 if the source code is on a network share

Registry information
Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall the operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.

If you have Visual Studio 2005 SP1 installed, you do not have to change the registry.

If you do not have Visual Studio 2005 SP1 installed, you must add and then enable the OptimizePDB registry entry to obtain the improved performance that this hotfix provides. To add the OptimizePDB registry entry, follow these steps:  Click Start, click Run, type regedit, and then click OK. Locate and then right-click the following registry key:

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\VB Editor

Note If you use Microsoft Visual Basic 2005 Express Edition, locate and then right-click the following registry key:

HKEY_CURRENT_USER\Software\Microsoft\VBExpress\8.0\VB Editor

 Click New, and then click DWORD Value. Type OptimizePDB, and then press ENTER. Right-click OptimizePDB, and then click Modify. Type 1, and then click OK.</li> Exit Registry Editor.</li></ol>

After you add the OptimizePDB registry entry, follow these steps:
 * 1) In Visual Studio 2005, start the Visual Basic application.
 * 2) On the Build menu, click Clean  .

Note The OptimizePDB registry entry improves the Visual Basic 2005 compiler. Therefore, the Visual Basic 2005 compiler can optimize the .pdb file. However, the new .pdb file format is not fully compatible with the old .pdb file format. Additionally, Visual Studio 2005 SP1 always uses the new .pdb file format. Therefore, a version of Visual Studio 2005 that does not have this hotfix applied or that does not have Visual Studio 2005 SP1 installed may be unable to recognize the new .pdb file format. To resolve this problem, use one of the following methods:
 * Apply this hotfix on all development computers.
 * Install Visual Studio 2005 SP1 on all development computers.
 * On the Build menu, click Clean  or click Rebuild   before you start to debug.

File information
This hotfix package includes the following hotfixes:
 * A Visual Studio 2005 hotfix
 * A .NET Framework 2.0 hotfix

If you have Visual Studio 2005 SP1 installed, and you are experiencing the symptoms that are described in this article, you must apply only the .NET Framework 2.0 hotfix to update the Visual Basic 2005 command-line compiler.

If you do not have Visual Studio 2005 SP1 installed, and you are experiencing the symptoms that are described in this article, you must apply both these hotfixes.

The English version of this hotfix package has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.

The .NET Framework 2.0 hotfix, Itanium-based versions
<div class="status_section">

STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section. This problem was first corrected in Visual Studio 2005 Service Pack 1.

<div class="moreinformation_section">

Problem 1
<ol> Start Visual Studio 2005.</li> On the File menu, click New Project.</li> Under Project types, click Visual Basic.</li> Under Templates, click Class Library.</li> Type Test for the project name, and then click OK.</li>  In the Class1.vb file, replace the existing code with the following code. Imports Test.ContainerClass(Of Test.ConcreteClass)

Public Class ErrorVB

Private d As DateTime = DateTime.Now

Public Sub Method1 Dim c1 As DateTime = d.Subtract(New TimeSpan(2, 0, 0, 0)) Dim c2 As DateTime = d.AddDays(2)

Dim x As InnerClass

End Sub

Public Sub Method2 Dim d1 As DateTime = d.Subtract(New TimeSpan(2, 0, 0, 0)) Dim d2 As DateTime = d.AddDays(2)

Dim x As InnerClass

End Sub

End Class

Public Class ContainerClass(Of T)

Public Class InnerClass

End Class

End Class

Public Class ConcreteClass

End Class </li></ol>

Problem 2
<ol> Start Visual Studio 2005.</li> On the File menu, click New Project.</li> Under Project types, click Visual Basic.</li> Under Templates, click Console Application.</li> Type a project name, and then click OK.</li>  In the Module1.vb file, replace the existing code with the following code. Module Module1

Sub Main Dim I As I1

I = New C2       I.A

I = New C3       I.A End Sub

End Module

Class C1   Implements I1

Private Sub X Implements I1.A       Console.WriteLine(&quot;C1's implementation of I1.A&quot;) End Sub

Private Sub Y Implements I1.B       Console.WriteLine(&quot;C1's implementation of I1.B&quot;) End Sub

End Class

Class C2   Inherits C1    Implements I1

Overridable Sub A Console.WriteLine(&quot;C2.A&quot;) End Sub End Class

Class C3   Inherits C1    Implements I1

Private Sub Z Implements I1.B       Console.WriteLine(&quot;C3's implementation of I1.B&quot;) End Sub

Overridable Sub A Console.WriteLine(&quot;C3.A&quot;) End Sub End Class

Interface I1   Sub A Sub B End Interface </li> On the Build menu, click Build .</li></ol>

You receive the following result: <pre class="fixed_text">C2.A C3.A However, you expect to receive the following result: <pre class="fixed_text">C1's implementation of I1.A C1's implementation of I1.A For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates

Keywords: kbqfe kbpubtypekc kbhotfixserver KB927511

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.