Visual Basic .NET or Visual Basic 2005 does not support the comImport attribute to manually declare a COM component (313506)
The information in this article applies to:
- Microsoft Visual Basic .NET (2002)
- Microsoft Visual Basic 2005
- Microsoft Visual Basic .NET (2003)
This article was previously published under Q313506 SYMPTOMS
You can use the Peverify.exe tool to verify Microsoft intermediate language (MSIL) and metadata information in a Visual Basic .NET .exe or Visual Basic 2005 .exe file. However, this verification procedure manually declares a Component Object Model (COM) component with a ComImport attribute, and you receive the following the error message:
[MD]: Error: Method marked Abstract/Runtime/InternalCall/Imported must have zero RVA, and vice versa. [token:0x06000003]
1 Errors Verifying test.exe
CAUSE
In Visual Basic .NET or in Visual Basic 2005, you cannot manually declare COM definitions. COM Interop provides access to an existing COM component but does not require that you modify the original component. To reference COM objects and interfaces in Visual Studio .NET or in Visual Studio 2005, you must include a .NET definition for the COM component. In Visual C# .NET, you can manually declare COM definitions if you use the ComImport attribute.
RESOLUTION
To resolve this problem, reference a COM component in Visual Basic .NET or Visual Basic 2005. To do this, add a COM reference to the project. Alternately, you can use the Type Library Importer (Tlbimp.exe) utility to manually create COM Interop assemblies.
STATUSThis behavior is by design.REFERENCES
For more information, refer to the following MSDN article:
Modification Type: | Minor | Last Reviewed: | 10/3/2006 |
---|
Keywords: | kbvs2005swept kbvs2005applies kbnofix kbprb KB313506 kbAudDeveloper |
---|
|