views:

548

answers:

1

When I create a Asp.net app and flip the appPool to "ASP.NET v4.0 Classic" it fails with the following error:

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

After some searching it seems to be the handler not mapping correctly for the Classic mode but I can't find out where or how to fix that.

I have the full .Net 4.0 install with VS2010 and the app works fine if I flip the appPool to Integrated. Also, it's a Windows 7 machine (I'm having the same problem on a Vista box). Thanks in advance.

Andy

A: 

I would start by calling aspnet_regiis.exe from the .net 4.0 directory. Also you can run the following command to see the list of handlers that are configured for your server: \windows\system32\inetsrv\appcmd.exe list config -section:handlers | findstr v4.0 | findstr Isapi

You should see the asp.net page factory, something like (in a 64-bit machine you should see them twice):

<add name="PageHandlerFactory-ISAPI-4.0_32bit" path="*.aspx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />

<add name="PageHandlerFactory-ISAPI-4.0_64bit" path="*.aspx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
CarlosAg
Thanks for the suggestion. I have tried aspnet_regiis.exe but it didn't help and I do have the two *aspx rows you pointed out when I run appcmd. But I'm still getting the "The requested content appears to be script and will not be served by the static file handler" error when I have the appPool on classic. Any other ideas?
AndyV
I figured it out. The machine had the handlers setup correctly but the Default Web Site my app was under did not. I'm not sure why it didn't propogate but to fix it I just had to open the Handler Mappings in the site and click "Revert To Inherited"
AndyV