Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MIME types missing in IIS 7 for ASP.NET - 404.17

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.
like image 996
MacGyver Avatar asked Jul 03 '12 21:07

MacGyver


1 Answers

Fix:

I chose the "ISAPI & CGI Restrictions" after clicking the server name (not the site name) in IIS Manager, and right clicked the "ASP.NET v4.0.30319" lines and chose "Allow".

After turning on ASP.NET from "Programs and Features > Turn Windows features on or off", you must install ASP.NET from the Windows command prompt. The MIME types don't ever show up, but after doing this command, I noticed these extensions showed up under the IIS web site "Handler Mappings" section of IIS Manager.

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>

However, I still got this error. But if you do what I mentioned for the "Fix", this will go away.

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.
like image 158
MacGyver Avatar answered Sep 19 '22 13:09

MacGyver