Error messages when you attempt to build a Class Library project in Visual Basic .NET or in Visual Basic 2005 (316163)
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 Q316163 SYMPTOMS
When you attempt to build a Class Library project in Visual Basic .NET 2002, and the project exposes a Collection type through Component Object Model (COM) interop, the build may fail with the following error message:
COM Interop registration failed. Error loading type library/DLL.
In Visual Basic .NET 2003, you receive the following error message: COM Interop registration failed. Could not find a type library for assembly 'Microsoft.VisualBasic'.
In Visual Basic 2005, you receive the following error messagess: error MSB3211:The assembly 'Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not registered for COM Interop. Please register it with regasm.exe /tlb. error MSB3212: Error: Error loading type library/DLL. CAUSE
This behavior occurs because the Collection type is defined in the Microsoft.VisualBasic.dll assembly. If the type library for Microsoft.VisualBasic.dll is not registered, the class library cannot be registered correctly.
RESOLUTION
To resolve this issue, follow these steps:
- Start the Visual Studio .NET Command Prompt or the Visual Studio 2005 Command Prompt.
- Change the current folder to one of the following folders:
- Windows Directory\Microsoft .NET\Framework\V1.0.3705
- Windows Directory\Microsoft .NET\Framework\V1.1.4322
- Windows Directory\Microsoft .NET\Framework\V2.0.50727
- Type the following command, and then press the ENTER:
regasm microsoft.visualbasic.dll
NOTE: This command creates and registers the type library for Microsoft.VisualBasic.dll.
- Switch back to Visual Studio .NET or Visual Studio 2005, and then rebuild the project.
STATUSThis behavior is by design.
Modification Type: | Major | Last Reviewed: | 1/25/2006 |
---|
Keywords: | kbvs2005swept kbvs2005applies kberrmsg kbprb KB316163 |
---|
|