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
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
This behavior is by design.
Back to the top