Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

false "missing assembly reference" in visual studio 2017

After upgrading VS2013 to VS2017 we have a lot of (3000+) errors from missing assembly references. But they are all false, the reference is still there and it works when we build the project and run it.

enter image description here

The problem with all these false errors are when we have an actual error, its hard to detect it since there are red errors everywhere in the project.

Removing the reference from the project and re-adding it works until VS is restarted.

In the output console, we only see the "true" errors.

We have tried to clean and rebuild without any difference.

like image 776
Robert Avatar asked Jan 24 '18 15:01

Robert


1 Answers

Found the cause of problems. For some reason vs 2017 adds the project reference with lowercase letters. But the project guid is in uppercase:

<ProjectReference Include="..\..\..\Utils\Utils.csproj">
  <Project>{17c4a8d4-c1ff-41e0-90e9-95f271801fde}</Project>
  <Name>Utils</Name>
</ProjectReference>

This is how it looks like in the Utils.csproj

...
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{17C4A8D4-C1FF-41E0-90E9-95F271801FDE}</ProjectGuid>
<OutputType>Library</OutputType>
...

After updating the references to match its now working.

like image 193
Robert Avatar answered Sep 30 '22 21:09

Robert