Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2017 error: Cannot find project info for "" This can indicate a missing project reference

Tags:

Just installed Visual Studio 2017 (full version) from MSDN website. Created a new Asp.Net Core Web Application (.Net Framework) with .net framework 4.6 selected. Project name = "WebApplicationWithTemplate"

Added another project of type Class Library (.Net Standard) again with .net framework 4.6 selected. Project name = "DataAccessRegular"

Next tried to add the reference of class library project to the Asp.Net Core web application and I get this error:

enter image description here

Cannot find project info for 'E:\Development\VS2017Solution\DataAccessRegular\DataAccessRegular.csproj'. This can indicate a missing project reference. WebApplicationWithTemplate C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk.targets 92

Also created Class Library (.net core) project [not shown in the screen shot above] and added its reference to asp.net core project and still getting the same error.

Also read This link on github but did not find it helpful unfortunately.

The point for asking this is because I want to keep the model, service and data access layers in a separate project.

like image 639
Yawar Murtaza Avatar asked Mar 07 '17 20:03

Yawar Murtaza


People also ask

How do I fix missing references 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.

What is reference path in Visual Studio project?

The Reference Path property tells Visual Studio where to look for referenced assemblies; the default is the path you used when you added the reference.


2 Answers

I got this problem after removing a nuget package (which I had built myself) from a solution then replacing it with a project reference to the project from which the package was built. The solution to the issue...? Close VS and reopen it.

like image 87
James Ellis-Jones Avatar answered Sep 20 '22 15:09

James Ellis-Jones


I resolved this by correcting my mistake that the reference was added both as a project reference AND as a browse reference.

The assembly was thus referenced twice - directly as an assembly - and indirectly as the output of a included project.

When I removed the browse reference and only kept the project reference it cleared up.

like image 35
Hans Karlsen Avatar answered Sep 20 '22 15:09

Hans Karlsen