Razor Host Factory error

后端 未结 9 1662
心在旅途
心在旅途 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-25 12:44

    1. Inside your Web project, open "References" tree node.
      1. Look for "Assemblies" folder and open it.
      2. Look for System.Web.Mvc, right click on it, and select "Properties"

    A dialog will prompt, read carefully the package full name field and look for the version number. For example, I have this one:

    System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35

    So, in the Web.config (inside Views folder) replace the version number!

    In my case, it originally was:

    Now I have (look at the Version value):

    Hope it helps!

提交回复
热议问题