Razor Host Factory error

后端 未结 9 1632
心在旅途
心在旅途 2020-12-25 12:00

I get a MvcWebRazorHostFactory error trying to run my app, but it\'s not an MVC app at all. I have the following web packages installed via nuget:

Microsoft         


        
相关标签:
9条回答
  • 2020-12-25 12:53

    This happened to me today. I just made sure the version number for the web.config in the views folder matches the version number for the web.config of the solution.

    Hope this helps.

    0 讨论(0)
  • 2020-12-25 12:54

    I resolved this issue by setting System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc Version to 5.2.0.0 and it worked, finally! Why 5.2.0.0? Same version as NuGet Microsoft ASP.NET project.

    So, the line in /Views/Web.Config should be:

    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    
    0 讨论(0)
  • 2020-12-25 12:56

    For the benefit of anyone developing ASP.NET MVC 5 web apps using Xamarin Studio v5.5.3 on OSX, deleting the /Views/Web.config did not work for me and created other errors.

    To fix it, open /Views/Web.config and change all instances of 5.2.0.0 to 5.2.2.0

    More details here

    0 讨论(0)
提交回复
热议问题