[RESOLVED]System.Web.Mvc broken after Microsoft Update

Today I woke up after a windows update last night, and my MVC project was broken (many missing namespace errors). Apparently, my System.Web.Mvc version was updated from 4.0.0.0 to 4.0.0.1 automatically and my project references were broken, see: http://stackoverflow.com/questions/26393157/windows-update-caused-mvc3-and-mvc4-stop-working

Following some threads, I went through my entire project and renamed references from 4.0.0.0 to 4.0.0.1, this resolved the errors, however now I am getting the following error:

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0234: The type or namespace name ‘Html’ does not exist in the namespace ‘System.Web.Mvc’ (are you missing an assembly reference?)

Source Error:

Line 36: <add namespace="System.Web.Mvc"/>
Line 37: <add namespace="System.Web.Mvc.Ajax"/>
Line 38: <add namespace="System.Web.Mvc.Html"/>
Line 39: <add namespace="System.Web.Optimization"/>
Line 40: <add namespace="System.Web.Routing"/>

I am a bit stumped as to what to do about this. The only item that I am currently thinking is that although I updated my System.Web.Mvc reference version numbers I did not update the publicKeyTokens, but I am unsure how to get those updated tokens, or if
this is really the problem/solution. Any ideas, its a pain to be automatically updated into an error that brings down your application.

Hi bobby,

Thanks for your post.

bobbydoogle

System.Web.Mvc broken after Microsoft Update

The problem can be resolved by implemented one of the following solutions:

  1. (Preferred) Install Microsoft.AspNet.Mvc from the NuGet gallery (this will install a binding redirect in your web.config).  You can do this from the NuGet package manager or the NuGet console inside Visual Studio:

    >Install-Package Microsoft.AspNet.Mvc -Version <version> -Project PROJECTNAME

  2. Manually update the reference to System.Web.MVC.dll (don’t use the one in the GAC).

    Try the Add Reference -> Assemblies -> Extensions dialog box. 

More information:

#Microsoft Asp.Net MVC Security Update MS14-059 broke my build!

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

 and

bobbydoogle

Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0234: The type or namespace name ‘Html’ does not exist in the namespace ‘System.Web.Mvc’ (are you missing an assembly reference?)

please check this:

The type or namespace name does not exist in the namespace ‘System.Web.Mvc’

Hope this can be helpful.

Best Regards,

Eileen

After changing 4.0.0.0 to 4.0.0.1 I simply had to make sure that the reference of property of copy local is changed  to true on System.Web.Mvc.

Leave a Reply