IIS Express 无法提供 cshtml 文件

发布于 2024-10-19 01:15:09 字数 598 浏览 2 评论 0原文

我刚刚开始检查 WebMatrix,但遇到了问题。我重新安装了 WebMatrix,然后开始了一个教程,其中涉及创建一个小的 cshtml 文件。每当我尝试运行该网站时,都会收到以下错误:


未提供此类型的页面。

描述:未提供您请求的页面类型,因为它已被明确禁止。扩展名“.cshtml”可能不正确。请检查下面的 URL 并确保其拼写正确。

请求的 URL:/Home.cshtml


在 IIS Express 请求部分,页面请求显示以下错误:

404.17 映射到静态处理程序的动态内容

详细信息:请求与通配符 mime 映射匹配,并与静态文件夹(所有拼写错误 MS 有何不同?)处理程序相匹配。但是,如果前提条件不同,请求将映射到不同的处理程序。这可能意味着先决条件不正确。


我尝试重新安装但无济于事。有人有什么想法吗?

我运行的是 Windows 7 Pro,安装了 IIS 7。 (IIS Express 应该能够并行运行没有问题)

非常感谢!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

恍梦境° 2024-10-26 01:15:09

它被设置为 4.0——卸载并重新安装 ASP.NET 网页就可以了。

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

陌伤ぢ 2024-10-26 01:15:09

看来您在设置部分(在WebMatrix中)选择了2.0 .NET框架。将其更改为“.NET 4(集成)”。

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

往事随风而去 2024-10-26 01:15:09

同样的船 - 只是玩弄它及其与 VS2010 的“集成工作流程”..但可惜,它并不像人们希望的那样“干净”(或者可能只是需要更多手动调整旋钮和开关)。

但请尝试以下操作(而不是或在放弃所有希望并重新安装之前):在管理员模式下运行 Webmatrix(右键单击 -> runas)。

你的解决方案是我必须在服务器端做的事情(IIS6/w2k3)....通过网络平台安装程序。虽然安装 Webmatrix 服务器端似乎很奇怪,但我只是放弃了,无论如何都这样做了,以确保所有依赖项都与其一起安装(不想花费或浪费更多时间来弄清楚它)。

为我工作......在看起来目光呆滞,“但昨天工作正常”的样子之后。因此,我希望这可以为您(以及其他任何人)节省一些时间并减少挫败感。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文