Last post Mar 25, 2011 06:30 PM by tomwayson
Mar 02, 2011 09:03 PM|wirjones525|LINK
Sorry to add another CSHTML handler thread to the forum, but here's my situation. We're trying to set up a server to run Webmatrix pages on an intranet site. We followed the recommended install shown on http://learn.iis.net/page.aspx/951/install-server-components/ with
Win Server 2009, IIS7 and all the ancillaries. I've opened IIS and successfully created an HTML website with a Hello World file in it. Then I created another website and copied over a WebMatrix demo site that I created on my local machine. When I try to
Browse a CSHTML page right out of the IIS Manager I get the error message:
HTTP Error 404.17 - Not Found
The requested content appears to be script and will not be served by the static file handler.
Detailed Error Information
Error Code 0x80070032
Requested URL http://localhost:82/ListCourses.cshtml
Physical Path C:\inetpub\wwwroot\test_webmatrix\ListCourses.cshtml
Logon Method Anonymous
Logon User Anonymous
In the Features view for this WebMatrix website I ran the Web Platform Installer and confirmed the following installations: WebMatrix, IIS 7 Recommended Installation, ASP.NET MVC3 (don't know if I need that last one.)
In the Forums thread on "Deploying a WebMatrix C# site to IIS7" (http://forums.asp.net/t/1584592.aspx?Deploying+a+WebMatrix+C+site+to+IIS7) there was a comment from someone
that they had to run a WebMatrix deployment to some (any?) FTP site to get it to compile the pages to a bin folder that they then copied over to the webserver. Is that something I need to do?
I haven't tried yet launching WebMatrix on that actual server and creating a demo site on the server. Should I do that?
Thanks so much,
Mar 03, 2011 05:54 AM|Mikesdotnetting|LINK
The forums at IIS is the best place to ask deployment related questions on WebMatrix. It shares the same membership as this site so you can use your existing username and password to log in there.
Mar 03, 2011 12:58 PM|wirjones525|LINK
Will do. Thanks, Bill
Mar 25, 2011 06:30 PM|tomwayson|LINK
Here's the link to the re-posted topic in the IIS forum:
It's a long thread, but after following the instructions there I was able get my site to serve .cshtml files.
Basically the problem seemed to be that the application pool the site was initially using was configured for ASP 2.0, so I set it to 4.0 integrated pipeline and followed the instructions (at the end of the above post) about reverting the Handler Mappings. However,
once I did that I noticed that .csthml pages were now mapped, but mapped to the forbidden handler.
I ended up running the Web Platform Installer on the server and noticed that ASP.Net MVC 3 wasn't installed (which shouldn't have mattered since this site is Web Pages, and not MVC), but I went ahead and installed it. I then repeated the handler mapping steps
and it worked.
Some things from the thread that didn't seem to make any difference were running "aspnet_regiis -i" in the ASP.Net 4.xxxx framework folder, and following the instructions to make sure that the ASP.Net Workload was properly installed (http://learn.iis.net/page.aspx/136/install-typical-iis-workloads/)
- which it looked like it already was.