IIS Express fails to serve cshtml files
Asked Answered
K

3

0

I've just started checking out WebMatrix, and am running into a problem. I performed a fresh install of WebMatrix, then started a tutorial which involves creating one small cshtml file. Whenever I try to run the site, I get the following error:


This type of page is not served.

Description: The type of page you have requested is not served because it has been explicitly forbidden. The extension '.cshtml' may be incorrect. Please review the URL below and make sure that it is spelled correctly.

Requested URL: /Home.cshtml


In the IIS Express Requests section, the page request shows the following error:

404.17 Dynamic Content Mapped to Static Handler

Details: The requested matched a wildcard mime map and was matched to the static filder (What's up with all the typos MS?) handler. However, if the pre-conditions were different, the request would map to a different handler. This can mean that the pre-conditions are incorrect.


I tried reinstalling to no avail. Does anybody have any ideas?

I am running Windows 7 Pro, with IIS 7 installed. (IIS Express is supposed to be able to run side-by-side no problemo)

Thanks much!

Knotting answered 24/2, 2011 at 23:0 Comment(1)
This can also happen due to an incorrect web.config setting #4886595Stamp
K
2

It was set to 4.0 -- Uninstalling and reinstalling ASP.NET Web Pages did the trick.

Knotting answered 22/3, 2011 at 15:37 Comment(0)
P
0

It seems you selected 2.0 .NET framework in Settings section (in WebMatrix). Change it to '.NET 4 (Integrated)'.

Primus answered 24/2, 2011 at 23:45 Comment(0)
C
0

Same boat - just toying with it and its "integrated workflow" with VS2010..but alas, it's not as "clean" as one would hope (or maybe just needs more manual tweaking of knobs and switches).

But try this (instead of, or before giving up all hope and re-installing): run Webmatrix in Administrator mode (right click -> runas).

Your solution is something I had to do on the server side though (IIS6/w2k3)....via web platform installer. While it seems odd to install Webmatrix server side, I just gave up and did it anyway to ensure all the dependencies are installed along with it (didn't want to spend or rather waste any more time figuring it out).

Worked for me....after looking glassy eyed with that "but it was working fine yesterday" look. So I hope this saves you (and anyone else) some time and frustration.

Cryometer answered 4/5, 2011 at 15:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.