Visual Studio Compilation Error (CS0234) after Windows Update

5 years ago
Ever since a Windows Update (I believe Security Update MS14-059 (KB2990942)) I cannot launch (to localhost) on 3 of the 5 team foundation servers I am connected to via Visual Studio 2012. For those 3, I get this error message (http://i.imgur.com/QYHsgD3.jpg).  I believe this update took place around October 26th or earlier in the month.

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?)

With a source error: Line 49:         <add namespace="System.Web.Mvc.Html" />


I cannot do a system restore before this update and have tried uninstalling multiple updates from that time as well as deleting and reconnecting to the team foundation server and uninstalling and installing Visual Studio 2012 again.

Also, the common fix I found after some research of setting Copy Local to True has yielded zero success.

Please let me know if you need more information. I tried my best to convey this problem as I am not a web developer. It's been over a week and I (as well as the IT department) cannot figure this out.

Does anyone have any information regarding this recent issue? It would be GREATLY appreciated.
5 years ago
Hi DJ_Balogh,

I see in the screenshot that the folder is 3.3 but in your signature I see nop 3.2.
Can you specify the exact version of nopCommerce you are using, so that we can advice?

Basically the error means that there is some version mismatch between several System.Web.MVC.dll file and more specifically the one in the GAC and the one you probably reference via Nuget package.
If you are referencing a specific Nuget package version of System.Web.MVC then you should set Copy Local to True for this reference, so that it is copied in to the Bin folder of your project and it can be loaded from there rather than from the GAC.

If you want to be sure the exact version is loaded then you can add some binding redirects in the Web.config.
There are already some binding redirects there so you can see them as a reference.

p.s: Here is a link that could be useful. Don't forget to check the Bin folder for the System.Web.MVC.dll file and its assembly version as it should be the same as the version specified in the Web.config!

Hope this helps!
5 years ago
It is 3.3.  We have tried adjusting the Copy Local to true but it did not solve this issue.
5 years ago
DJ_Balogh wrote:
It is 3.3.  We have tried adjusting the Copy Local to true but it did not solve this issue.


Hi DJ_Balogh,

OK in 3.3 you should reference it from here:
packages\Microsoft.AspNet.Mvc.5.1.1\lib\net45\System.Web.Mvc.dll

Did you check if System.Web.Mvc.dll is present in Nop.Web\Bin folder and its assembly version is 5.1.0.0?
5 years ago
Thank you. IT did the following:

Select System.Web.Mvc under Presentation\Nop.Web\References.
Go to Properties and set Copy Local = True.

And now I am up and running! Thanks for the help.
5 years ago
Yes, that is it. I also got this weird error after updating.