Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2012: Project cannot be referenced

We developed a large solution containing ~35 projects with VS 2010, now we are thinking about migrating to VS 2012 Ultimate. I converted the solution file to VS 2012 and generally, everything works fine.

But whenever I open the solution, I get some warnings on a certain project A in the solution: "The project X cannot be referenced" "The project Y cannot be referenced" ... where A has project-references to X and Y. When I build the solution, I get errors that the Metadata of each respective DLL could not be found.

When I look at the references in the solution explorer, they are marked with a yellow warning-symbol. As soon as I simply click on the reference, the warning goes away and the icon looks normal. Then I can build without errors!

The problem occurs each time I open the solution, the affected projects are always the same.

Did anyone else experience this odd behavior? Deleting and adding the project references again did not help...

Thank you in advance.

EDIT: I checked the csproj file of the referencing project and I wonder that all project reference GUIDs having the above problem are written lowercase, other projects are uppercased.

<ProjectReference Include="..\Presentation.Net\Presentation.Net.csproj">
  <Project>{04004c6b-76c8-4f2d-9fcf-5a866bb80fd4}</Project>
  <Name>CMS.Presentation.Net</Name>
</ProjectReference>

While within the solution the GUIDs are uppercased:

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Presentation.Net", "Presentation.Net\Presentation.Net.csproj", "{04004C6B-76C8-4F2D-9FCF-5A866BB80FD4}"

Any ideas?

like image 324
mbue Avatar asked Feb 26 '13 12:02

mbue


People also ask

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 reference in Visual Studio 2012?

You can also right-click the project node and select Add > Project Reference. If you see a References node in Solution Explorer, you can use the right-click context menu to choose Add Reference. Or, right-click the project node and select Add > Reference.


2 Answers

VS 2012 dropped support for some of the older project types. Not all of the VS 2010 project types are supported in VS 2012. For instance, the MSI setup project types have been replaced by InstallShield LE project types. Check the compatibility list here and see if any of your failing project types are an issue.

like image 200
Jordan Parmer Avatar answered Sep 24 '22 10:09

Jordan Parmer


This pointed me into the right direction. Visual Studio 2012 Randomly reporting: "The referenced component X could not be found"

At least the warnings go away. Have to check whether the metadata errors will occur again.

like image 45
mbue Avatar answered Sep 25 '22 10:09

mbue