Search code examples
.netvisual-studio-2012.net-4.5

Visual Studio 2012 Randomly reporting: "The referenced component X could not be found"


I recently migrated and re-tartgeted a solution from VS 2010 and .NET 4.0 to VS 2012 and .NET 4.5. However now all of a sudden and randomly VS 2012 reports almost all cross-project references as:

"The referenced component X could not be found" (warning)

Now, I know for a fact that this is not correct. Firstly because I can see the assembly in the directory set for the assembly reference and secondly because when I bring up the "Add Reference" dialog the warning suddenly goes away and so do the yellow warning icons on the assembly reference

Doing a full rebuild clears the warning and then it will stay that way for a while and then randomly the same warnings show again.

Has anyone seen this? What can be the cause and how can I fix it?

Edit: I was not seeing this weird behaviour in VS 2010

Edit: The warnings are reported for references to other projects in the same solution.


Solution

  • It is caused by parallel build. Setting "maximum number of parallel project builds" to 1 will resolve the issue.

    See also: http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/a9ac83eb-14b3-4bd2-bc51-7c2ae7363c46