Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC4 solution fails to build after installing KB2993928

We have an ASP.NET MVC 4 solution with a couple of references that has been building without problems for about 2 years now. However, after installing KB2993928 and KB2993937 this morning, we cannot run FxCop on this solution on our Windows 7 machines anymore.

I have a feeling this is because this update changed the DLL version of the System.Web.Mvc assembly in the GAC. This is because in the GAC I can currently find 3 different System.Web.Mvc DLLs, which are all updated today.

The error we receive in the build is as follows:

6>MSBUILD : error : CA0001 : The following error was encountered while reading module 'FrontEnd.Implementation': Assembly reference cannot be resolved: System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35. [C:\Project\FrontEnd\02-Implementation\02-Implementation.csproj]
6>MSBUILD : error : CA0058 : The referenced assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be found. This assembly is required for analysis and was referenced by: S:\Deliverables\FrontEnd\bin\FrontEnd.Implementation.dll. [C:\Project\FrontEnd\02-Implementation\02-Implementation.csproj]

Since we use ASP.NET MVC 4, this version 3.0 DLL is referenced indirectly by one of our references. For instance, RazorGenerator references version 3.0.0.0. Possibly others as well. There is no new version of RazorGenerator from what I can tell.

The System.Web.Mvc versions I see in the GAC are: 3.0.50813.1, 4.0.40804.0 and 5.0.20821.0.

I removed the reference to System.Web.Mvc from our projects and added Mvc as a NuGet package instead. This fixes our compilation, but FxCop still doesn't work due to the indirect references.

If any additional information is required please let me know.

like image 746
Olaf Keijsers Avatar asked Oct 15 '14 14:10

Olaf Keijsers


3 Answers

If this issue is caused by references which in turn have dependencies on those specific assemblies, you can remedy this by coercing FxCop to use only the StrongName and ignore the version number. This solution is described here.

Of course the real solution would be to update the referenced assemblies (with the indirect dependencies) to newer versions.

like image 172
Peter Avatar answered Oct 29 '22 08:10

Peter


Solution:

  1. Uninstall the MVC Framework via "Programs and Features" (whichever version you're using)
  2. Re-install MVC Framework (http://www.asp.net/mvc/mvc4)

Should fix the problem - no changes to the build/solutions is required.

like image 23
David Airapetyan Avatar answered Oct 29 '22 08:10

David Airapetyan


This was done by a security update on October 15th from Windows Update. You will need to run the updates on your build servers too.

Link to update: http://www.microsoft.com/en-ie/download/details.aspx?id=44533

This update fixes other versions as well.

You will likely have to update your projects to the newer version, as it changes the version number and removes the older version completely.

like image 26
Sean Avatar answered Oct 29 '22 10:10

Sean