Search code examples
c#.netasp.net-mvc

.Net Framework You must add a reference to assembly mscorlib, Version=4.0.0.0


After updating and including some NuGet packages, I now get many compile errors similar to:

The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

I looked at You must add a reference to assembly mscorlib, version=4.0.0 but I'm not running .Net core - this is an ASP.NET MVC, .Net Framework 4.7.2 Project.

There is no project.json to update. I already included the Microsoft.NETCore.Portable.Compatibility NuGet package to no effect.

What is causing this, and how can I fix it?


Solution

  • For completeness's sake, I'll include the fix that actually worked for me as an answer.

    Just delete the repo, re-clone, and try again.