System.Web.Mvc not functioning as expected after Windows Update

35,952

Solution 1

The recent updates have incremented version numbers

3.0.0.0 -> 3.0.0.1 and 4.0.0.0 -> 4.0.0.1

I had to remove the reference and re-add (System.Web.Mvc is found in Assemblies >Extensions are of the Add Reference dialogue)

Solution 2

I have same problem today after windows update. There is my solution.

Install-Package Microsoft.AspNet.Mvc -Version 5.2.0.0 -Project PROJECTNAME

Also you can try use these code maybe it helps.

Uninstall-Package Microsoft.AspNet.Mvc -Force

Goodluck.

Solution 3

There are two ways to fix this:

Option 1: Add Microsoft.AspNet.Mvc using NuGet

Use NuGet to add the latest revision of the MVC version you depend on to your project. Microsft recommends this approach.

Option 2: Update assembly reference

If you add a new assymbly reference to your project you'll see that the System.Web.Mvc assemblies are now versioned x.0.0.1.


Source: http://blogs.msdn.com/b/webdev/archive/2014/10/16/microsoft-asp-net-mvc-security-update-broke-my-build.aspx

I would suggest against bluntly attempting reinstalling MVC. Allthough it worked for me in the end, you'll run into trouble with NuGet being bundled with the MVC installer.

You need to uninstall NuGet prior to reinstalling MVC because NuGet still being present causes the MVC installer to refuse to install or to fail.

In addition I don't see why reinstalling MVC will prevent Windows Update from applying the update again after you reinstalled MVC.

Solution 4

As the patch has incremented the version number has risen from (for MVC4 it has risen from 4.0.0.0 to 4.0.0.1) the Reference Path in the project files needs to change from:

<Reference Include="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
  <Private>True</Private>
  <HintPath>..\bin\System.Web.Mvc.dll</HintPath>
</Reference>

to

<Reference Include="System.Web.Mvc, Version=4.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>..\bin\System.Web.Mvc.dll</HintPath>
</Reference>

Obviously adjust the hint path as appropriate, and make similar changes for other versions of MVC

Share:
35,952
matt
Author by

matt

More than just a student. :)

Updated on July 09, 2022

Comments

  • matt
    matt almost 2 years

    After yesterday's Windows Update, I seem to have issues building my projects.

    Related Windows Updates could be:
    ASP.NET MVC 2.0: KB2993939
    ASP.NET MVC 3.0: KB2993937
    ASP.NET MVC 4.0: KB2993928
    ASP.NET MVC 5.0: KB2992080
    ASP.NET MVC 5.1: KB2994397
    

    System.Web.Mvc-related errors

    These errors all seem to be related to the System.Web.Mvc namespace of which I checked; it is still being associated with the project under References. What could have gone wrong with my MVC project during the Windows Update, and how should I go about rectifying it?

    Here is the log that indicates the updates administered today:

    16/10/2014's Windows Update