C# – How to resolve? Assuming assembly reference ‘System.Web.Mvc


With reference to questions/26393157/windows-update-caused-mvc3-and-mvc4-stop-working. The quickest way to resolve the warning below?

Assuming assembly reference 'System.Web.Mvc, Version=,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' matches
'System.Web.Mvc, Version=, Culture=neutral,
PublicKeyToken=31bf3856ad364e35', you may need to supply runtime

Best Solution

I've had this happen with my NuGet packages every once in a while. I haven't been able to identify exactly how it happens. (I assume user error.) I didn't need to upgrade anything to solve it, just clear the NuGet cache:

I use the nuget command line tool found here.

You can clear all caches with this command:

nuget locals all -clear

See: https://docs.nuget.org/consume/command-line-reference

You'll probably need to restart Visual Studio if it is open.