Reputation: 13216
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.
Upvotes: 19
Views: 11405
Reputation: 1
Add another project of same type in the solution. Wait for a while. Issue will be solved. Remove the newly added project.
Upvotes: -1
Reputation: 2105
I just had similar issue with 31 projects and it turned out to be framework version mismatch - you should check framework version dependencies.
In my case, 4.0 library failed to build because it was dependent on 4.5 libraries and it was failing to resolve types from the 4.5 libraries.
Upvotes: 6
Reputation: 2566
Please go vote "I can reproduce this", if you also have this problem.
We have it constantly in solution with 75 projects in VS 2012.
Upvotes: 0
Reputation: 186
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
Upvotes: 17
Reputation: 35255
Seen this behaviour sometimes in VS 2008, and 2010 after project version upgrade. Usually removing and adding references again fixes issues.
Upvotes: 2