13

When getting a newly configured Windows 7 box, I noticed that ASP.NET was turned off by default. So was classical ASP. I was getting a 404.17 error for a web application. I think it's because I don't have an "aspx" MIME type. Although that's just a guess. When I turned them on under Control Panel > Programs and Features > Turn Windows Features on or off, and restarted my Windows 7 machine, the MIME types never showed up. Can someone check what MIME type they have for *.aspx pages, and tell me the configuration in edit mode? What other MIME types would I be missing for ASP.NET extensions (ie: ashx, asax, etc...)? What is the best way to configure them all?

    Error Summary
    HTTP Error 404.17 - Not Found
    The requested content appears to be script and will not be served by the static file handler.

...

Module: StaticFileModule
Notification: ExecuteRequestHandler
Handler: StaticFile
Error Code: 0x80070032
Requested URL: ...
Physical Path: ...
Logon Method: NTLM
Logon User: {DOMAIN}\{WINDOWS LOGIN}

...

Most likely causes:

The request matched a wildcard mime map. The request is mapped to the static file handler. If there were different pre-conditions, the request will map to a different handler.

...

Things you can try:

If you want to serve this content as a static file, add an explicit MIME map.
4

2 回答 2

18

使固定:

在 IIS 管理器中单击服务器名称(不是站点名称)后,我选择了“ISAPI 和 CGI​​ 限制”,然后右键单击“ASP.NET v4.0.30319”行并选择“允许”。

从“程序和功能 > 打开或关闭 Windows 功能”打开 ASP.NET 后,您必须从 Windows 命令提示符安装 ASP.NET。MIME 类型从未出现,但在执行此命令后,我注意到这些扩展出现在 IIS 网站的 IIS 管理器的“处理程序映射”部分下。

C:\>cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>dir aspnet_reg*
 Volume in drive C is Windows
 Volume Serial Number is 8EE6-5DD0

 Directory of C:\Windows\Microsoft.NET\Framework64\v4.0.30319

03/18/2010  08:23 PM            19,296 aspnet_regbrowsers.exe
03/18/2010  08:23 PM            36,696 aspnet_regiis.exe
03/18/2010  08:23 PM           102,232 aspnet_regsql.exe
               3 File(s)        158,224 bytes
               0 Dir(s)  34,836,508,672 bytes free

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis.exe -i
Start installing ASP.NET (4.0.30319).
.....
Finished installing ASP.NET (4.0.30319).

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>

但是,我仍然收到此错误。但是,如果您按照我提到的“修复”操作,这将消失。

HTTP Error 404.2 - Not Found
The page you are requesting cannot be served because of the ISAPI and CGI Restriction list settings on the Web server.
于 2012-07-03T21:31:43.640 回答
1

您可能会收到此消息的原因有两个:

  1. 未配置 ASP.Net。为此从管理员命令运行%FrameworkDir%\%FrameworkVersion%\aspnet_regiis -i。仔细阅读消息。在 Windows8/IIS8 上,它可能会说不再支持此功能,您可能必须在控制面板的安装/卸载程序中使用打开/关闭 Windows 功能对话框。
  2. 发生这种情况的另一个原因是您的应用程序池配置不正确。例如,您为 WordPress 创建了网站,并且还想在其中放入一些 aspx 文件,WordPress 创建的应用程序池显示不运行 CLR 内容。要解决此问题,只需打开 App Pool 并启用 CLR。
于 2014-02-22T00:45:09.187 回答