Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c#

asp.net

iis-7

I purchase hosting from bigrock When I run simple aspx page this error occured

HTTP Error 404.17 - Not Found The requested content appears to be script and will not be served by the static file handler. Detailed Error Information Module StaticFileModule Notification ExecuteRequestHandler Handler StaticFile Error Code 0x80070032 Requested URL http://demo.com:80/demo/default.aspx Physical Path C:\Inetpub\vhosts\demo.com\httpdocs\demo\default.aspx Logon Method Anonymous Logon User Anonymous 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 460
Lingraj Gowda Avatar asked Dec 20 '22 17:12

Lingraj Gowda


2 Answers

This is because .Net isn't configured correctly in IIS.

I ran into this in Windows Server 8 under IIS - Even after installing .Net 3.5 (and hence 2.0) IIS wasn't configured properly - So the static file handler was trying to handle .aspx requests - Resulting in this error.

The fix is simple:

Launch Command Prompt - Start - cmd.exe cd C:\Windows\Microsoft.NET\Framework64[Dot Net Version] aspnet_regiis -ir You should see output like:

Start installing ASP.NET [Dot Net Version]. ................ Finished installing ASP.NET [Dot Net Version].

At this point if you refresh your page it should work properly.

like image 53
Suvabrata Roy Avatar answered Apr 05 '23 23:04

Suvabrata Roy


The fix for us was to manually edit the system.webServer/handlers in the IIS configuration editor and replace .NET 2 ISAPI module with .NET 4 ISAPI module.

applicationHost.config Before (system.webServer/handlers)

<add name="AboMapperCustom-396397" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" requireAccess="None" preCondition="classicMode,runtimeVersionv2.0,bitness64" responseBufferLimit="0" />

applicationHost.config After (system.webServer/handlers)

<add name="AboMapperCustom-356384" path="*" verb="*" modules="IsapiModule" scriptProcessor="c:\windows\microsoft.net\framework64\v4.0.30319\aspnet_isapi.dll" requireAccess="None" responseBufferLimit="0" />

Essentially it was running the application through the wrong ISAPI module - even though we specified it properly in the App Pool.

We also had to enable the .NET 4 ISAPI module - it had been turned off by a previous admin.

Alternate Solution - Application Pool Misconfigured

We also see this same error when a .NET 2.0 Application (Classic mode) is serving up .NET 4 (Integrated mode) content. Switching the Application Pool from v2.0 to v4.0 fixed the issue. This same issue could also be from Application Pools v1.1 misclassified as v2.0.

like image 25
SliverNinja - MSFT Avatar answered Apr 06 '23 01:04

SliverNinja - MSFT