c# - Mono MVC5 - Views don't work -


I am trying to launch MVC5 website on my Linux box using Mono and XSP4. It works with any view, but when I try to render something, I get errors.

Here is my test code. I note that I did not change anything, it is basically an empty site without EF or any other libraries just non-bone MVC 5 + razor

  public performance index () {// return content ("good"); // works see return ();}   

System.Invideo Operation Exception

Razor Host could not locate the factory type: System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version = 5.0.0.0, Culture = fair, public keynation = 31BF3856AD364E35

Description: HTTP 500. Error processing request.

Description: Non-web exception exception origin (application or object name): System.Web.WebPages.Razor.

Stacktrace

  on the system. Web.WebPages.Razor.WebRazorHostFactory .CreateFactory (System.String typeName) [0x00000] of & lt; filename Unknown & gt; : 0 System.Collections.Concurrent.ConcurrentDictionary/2+ at GetOrAdd & gt; c__AnonStorey3 [System.String, System.Func`1 [System.Web. WebPages.Razor.WebRazorHostFactory]] & lt; & gt; ; m__0 () [0x00000] & lt; file name is unknown & gt ;: 0 (wrapper representative-call) on System.Func`1 & lt; System.Collections.Generic.KeyValuePair`2 & LT; String, System.Func`1 & lt; System.Web.WebPages.Razor.WebRazorHostFactory & gt; & Gt; & gt ;: invoke_TResult__this__ () ...   

I have tried to change version = 5.0.0.0 but nothing works for 4.0.0.0 and 3.0.0.0 etc. . I still get the same error which is now 4.0.0.0.

Is there any hope?

The problem is in Web.config inside / view < / Code> folder The system.web.webPages.razor host parameter must match exactly with the MVC version.

For example, if you have MVC 5.2.2.0, then it should look like & lt; Host factoryType = "System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version = 5.2.2.0, Culture = Neutral, PublicKeyToken = 31BF3856AD364E35" />.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -