Article ID: 313506 - Last Review: December 6, 2006 - Revision: 2.3 Visual Basic .NET or Visual Basic 2005 does not support the comImport attribute to manually declare a COM componentThis article was previously published under Q313506 On This PageSYMPTOMS
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. MORE INFORMATIONSteps to Reproduce Behavior
REFERENCES
For more information, refer to the following MSDN article:
Referencing COM Objects from Visual Basic .NET http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcn7/html/vatskReferencingCOMObjectsFromVisualBasicNet.asp (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcn7/html/vatskReferencingCOMObjectsFromVisualBasicNet.asp) | Article Translations
|
Back to the top
