Help and Support

"A reference to your project.proj could not be added" error message occurs when you try to add a reference to a project from the project dialog box in Visual Studio .NET

Article ID:318165
Last Review:March 6, 2006
Revision:1.2
This article was previously published under Q318165
On This Page

SYMPTOMS

If you try to add a reference by clicking Browse in the Add Reference dialog box and browsing to a Visual Studio .NET project file, you receive the following error message:
A reference to your project.proj 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.
Note Because there is a Project tab in the Add Reference dialog box, you may think that you can add a "project" file; however, you can only add a "project" reference if you first add the project to your solution. Neither the documentation nor the error message explains this fact.

Back to the top

RESOLUTION

To resolve this issue, add a project reference by following these steps:
1.In the Solution Explorer, right-click the solution, and then click Add and Existing Project.
2.Browse to the project file that you want to add, and then click Open.
3.In the Solution Explorer, right-click your original project name, and then click Add Reference. Click the Project tab.
4.Select the project that you added to the solution, click Open, and then click OK.
Note These steps work only if the output type of the project that is being referenced is a .dll file. You cannot reference .exe files.

Back to the top

STATUS

This behavior is by design.

Back to the top

MORE INFORMATION

Steps to reproduce behavior

1.In Visual Studio .NET, create a Microsoft Visual C# Windows Application.
2.In the Solution Explorer, right-click the project name, and then click Add Reference. Click the Project tab.
3.Click Browse, change Files of Type to All, and then select a project file. Click Open and then click OK. You receive the following error message:
A reference to your project.proj 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.

Back to the top


APPLIES TO
Microsoft Visual Studio .NET 2002 Professional Edition
Microsoft Visual Studio .NET 2002 Enterprise Architect
Microsoft Visual Studio .NET 2002 Enterprise Developer
Microsoft Visual Studio .NET 2002 Academic Edition
Microsoft Visual Studio .NET 2003 Professional Edition
Microsoft Visual Studio .NET 2003 Enterprise Architect
Microsoft Visual Studio .NET 2003 Enterprise Developer
Microsoft Visual Studio .NET 2003 Academic Edition

Back to the top

Keywords: 
kbvs2005doesnotapply kbvs2005swept kbtshoot kberrmsg kbprb KB318165

Back to the top

Article Translations

 

Other Support Options

  • Need More Help?
    Contact a Support professional by Email, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.