【问题标题】:MIME types missing in IIS 7 for ASP.NET - 404.17IIS 7 for ASP.NET 中缺少 MIME 类型 - 404.17
【发布时间】:2012-07-04 09:08:14
【问题描述】:

当获得一个新配置的 Windows 7 机器时,我注意到默认情况下 ASP.NET 是关闭的。经典的 ASP 也是如此。我收到一个 Web 应用程序的 404.17 错误。我认为这是因为我没有“aspx”MIME 类型。虽然这只是猜测。当我在“控制面板”>“程序和功能”>“打开或关闭 Windows 功能”下打开它们并重新启动我的 Windows 7 机器时,MIME 类型从未出现过。有人可以检查 *.aspx 页面的 MIME 类型,并告诉我编辑模式下的配置吗?对于 ASP.NET 扩展(即:ashx、asax 等),我会缺少哪些其他 MIME 类型?配置它们的最佳方式是什么?

    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.

【问题讨论】:

    标签: asp.net iis http-status-code-404 configure


    【解决方案1】:

    修复:

    点击服务器后我选择了“ISAPI & CGI Restrictions” IIS 管理器中的名称(不是站点名称),然后右键单击 “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.
    

    【讨论】:

    • 你能列出你打开了哪些 IIS7 设置吗?
    • 您是否要求我在运行“aspnet_regiis.exe -i”命令后出现的“处理程序映射”部分下看到的设置?有几个(即:asmx、ashx、aspx、asax 等)
    • 在控制面板中,我转到“程序和功能 > 打开或关闭 Windows 功能 > Internet 信息服务 (IIS) > 万维网服务 > 应用程序开发功能 > ASP.NET” ...等等
    • 请注意,当你安装 IIS 时,你有一个 iis -options- 列表。你能列出所有你勾选的选项吗?
    • IIS 已安装。 ASP.NET 不是,所以我必须手动打开它。我不记得我选择的其他人。
    【解决方案2】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-09-16
      • 2014-11-26
      • 1970-01-01
      • 2018-03-07
      • 2010-09-18
      • 2016-05-13
      • 2011-11-15
      相关资源
      最近更新 更多