6

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.

Robert
  • 2,357
  • 4
  • 25
  • 46

3 Answers3

10

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.

Robert
  • 2,357
  • 4
  • 25
  • 46
3

Deleting hidden .vs folder in your folder containg .suo file in most cases fixes the issue. Please see: Visual Studio shows IntelliSense errors but solution compiles

Angel Dinev
  • 399
  • 4
  • 13
0

In my case, I was running Visual Studio 2017 on Windows Server 2016 and all the projects were set to .NET Framework 4.5.2. I changed them to .NET Framework 4.6 and that solved the problem. Not sure why though.

deepakjg
  • 11
  • 2