Question

Background:

I currently have a working ASP.NET4.0 + Razor2.0(view engine only, no MVC) + mod_mono + Apache + mono3.0.4 + Ubuntu12.10 on a cloud server provider. I found another service provider which is more cost-effective than my current one.

The Issue:

This server is running on Ubuntu13.04 and was able to compile Mono 3.2.5(the latest release on Mono site). I configured it almost identical to my other server and made a simple CSHTML page which works on my MSVS2010; a simple page with layout. I uploaded everything to the directory and when I tried to open the page, instead of being rendered, the server only let me download the whole cshtml file.

I added these lines in mod_mono.conf:

<IfModule mod_mono.c>
        MonoAutoApplication enabled
        MonoServerPath /usr/bin/mod-mono-server4
</IfModule>

AddType application/x-asp-net .cshtml

Then on my virtual hosting file for Apache2, I added these lines to let Mono handle everything:

<Location /mono>
    SetHandler mono-ctrl
        Order deny,allow
        allow from all
</Location>

My configurations are identical to my previous server which is working properly. The only difference I know is I'm using Mono 3.2.5 and Ubuntu 13.04, also I'm using the master branch of XSP, mod_mono, and libgdiplus. I pulled the code through git.

UPDATE

I checked again the the current stable version of Mono and found out that it is 3.2.4 so I re-compiled it to this version but the the issue is still there.

UPDATE 10-Dec 2013 I was able to rebuild the server using Debian 7.0 and it is already running ASP.NET 4.0(and theoretically even 4.5). It can now run properly execute regular ASPX but not CSHTML.

The page runs properly under IIS on MS Windows 7 but it can't render and just download the page when I try to run it on mod_mono(mono 3.2.7 runtime) + Apache2 + Debian or XSP4 + Windows 7 though both can run ASPX pages properly. This test site still runs on my older server running mod_mono(mono 3.0.4 runtime) + Apache2 + Ubuntu 12.10. Both servers have the same configuration on both mod_mono.conf and site(/etc/apache2/sites-enabled/000-default) but can't make it run on my new server.

Was it helpful?

Solution

Even if the following are already in the GAC, copying and placing the files in the "bin" directory fixed the issue: System.Web.Helpers.dll System.Web.Razor.dll System.Web.WebPages.dll System.Web.WebPages.Razor.dll

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top