Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to add project reference in Visual Studio 2015

Tags:

I previously asked a similar question regarding Visual Studio 2013 but now I'm running into the same problem with Visual Studio 2015 but it seems to work differently, which makes the previous answer not applicable to this question. This is my previous question: Visual Studio 2013 - How to debug a project within a solution

I'm attempting to add a project reference. I have a library I'm working on in a separate solution/project and a console application I want to use to test and debug the library.

I tried: Add Reference > Projects > Solution > Browse

But the open file dialog does not contain .sln files in the filter list and if I force it to display them by typing *.sln and then select the Solution I get:

"Please make sure the file is accessible and that it is a valid assembly or COM component."

What am I doing wrong? How do I properly add a Solution/Project reference?

enter image description here

like image 606
user9993 Avatar asked Aug 09 '15 12:08

user9993


People also ask

How do I enable references in Visual Studio?

Restart Visual Studio, create a new C# UWP app project, and then right-click on the project and choose Add Reference. Go to the Windows tab, then the Extensions sub-tab, and select the Extension SDK. Look at the right pane in the Reference Manager.

How do I resolve a reference problem in Visual Studio?

To fix a broken project reference by correcting the reference path. In Solution Explorer, right-click your project node, and then select Properties. The Project Designer appears. If you're using Visual Basic, select the References page, and then click the Reference Paths button.

How do I add a project reference code in Visual Studio?

Right click on project --> Add Reference --> Select the reference project from the list.

How do I add a project to source control in Visual Studio 2015?

a Right-click the project in the Solution Explorer pane and select Add Project to Source Control. Note that within solutions that are not under source control, you can only add one project at a time.


1 Answers

For me issue was due to difference in Target framework. One was .NET Framework 4.5 and other was .NET Framework 4.5.2

Verify if the Target framework is same for your project and the project reference that you are trying add reference.

(Right click on project -> properties -> Application Tab(Target frame work))

like image 119
NidhinSPradeep Avatar answered Oct 01 '22 04:10

NidhinSPradeep