I did a Windows update and afterwards my asp.net mvc 5 application will no longer load complaining about
CS0234: The type or namespace name 'Html' does not exist in the namespace 'System.Web.Mvc'
indicating my views web.config is at fault
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Optimization"/>
<add namespace="System.Web.Routing" />
<add namespace="Ogre.Extensions" />
<add namespace="Newtonsoft.Json"/>
</namespaces>
</pages>
</system.web.webPages.razor>
Now this is very confusing. In my project itself I can see the Html
namespace, opening my assembly in ILSpy I can navigate to the bound System.Web.Mvc
and I can it as well, and the fusion log is not showing any suspicious binding errors.
It's as if just my views are getting bound (successfully) to an old version of Mvc. Why would that ever happen? How can I fix it?
Let me be clear that there have been no configuration or even code changes. This is all on my dev machine on IISExpress. It was running, I did the update and rebooted and now it is no longer running.
Here are my recent installs from the update. I could start removing them one by one, but I want to know what is actually going wrong as it feels like I'm missing part of the story.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…