Search code examples
asp.netmonoasp.net-webpagesxsp

Preview an ASP.NET .CSHTML file in XSP


Is there a way to force XSP on Mono to parse .cshtml files in order to be able to only preview them before doing the routing? Could the setting be forced?

Currently, the server only forwards the file for download and does not process it.

Running latest stable version of Mono (3.12.1) on CentOS 7. enter image description here


Solution

  • Well, it turned out that I needn't have made a local copy of Microsoft.Web.Infrastructure assembly. By doing this, I am finally able to run .CSHMTL files from XSP.enter image description here

    EDIT: To set a default .cshtml page add the following XML node to the appSettings section of the Web.config to give a hint to the XSP server:

    <add key="MonoServerDefaultIndexFiles" value="HelloWorld.cshtml, helloworld.cshtml" />