Visual Studio .NET or Visual Studio 2005 cannot add a reference to an executable assembly (821631)
The information in this article applies to:
- Microsoft Visual Studio 2005 Professional Edition
- Microsoft Visual Studio 2005 Standard Edition
- Microsoft Visual Studio .NET (2003), Professional Edition
- Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
- Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2003), Academic Edition
- Microsoft Visual Studio .NET (2002), Professional Edition
- Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
- Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2002), Academic Edition
SYMPTOMSWhen you add a reference to an executable assembly by using
the Visual Studio .NET or Visual Studio 2005 IDE, you receive
the following error message: A reference to
'assemblyname.exe' could not be added. This is not a valid assembly or
COM component. Only assemblies with extension 'dll' and COM components can be
referenced. Please make sure that the file is accessible, and that it is a
valid assembly or COM component. WORKAROUNDTo work around this problem, add the reference to the executable
assembly by using the command-line compiler. To do this, follow these steps:
- On the View menu in Visual Studio .NET or in Visual Studio 2005, point to Other Windows, and then click Command Window.
- At the command prompt, change the directory to C:\ConsoleApp1.
- Type the following command at the command prompt, and then press ENTER:
vbc module1.vb /r:c:\WinApp1\Bin\WinApp1.exe Notice that Module1.exe builds
successfully.
STATUS This
behavior is by design.REFERENCESFor more information about how to add or remove references by using
Visual Studio .NET, visit the following Microsoft Web
site:
Modification Type: | Major | Last Reviewed: | 3/6/2006 |
---|
Keywords: | kbvs2005swept kbvs2005applies kbCompiler kbDLL kberrmsg kbprb KB821631 kbAudDeveloper |
---|
|