Script not served by static file handler on IIS7.5

asp.netWindowsIisIis 7.5

asp.net Problem Overview


I've just tried to deploy my first web application to IIS on my Windows 7 Home Premium notebook. After creating the application, I had to change to the Classic App Pool, then set that pool for framework 4.0. Now I get 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.

The requested URL is http://localhost:80/pvmms/default.aspx

I'm afraid extensive Googling has yielded nothing clear or definite enough for me to work with and as usual I've turned to the experts.

EDIT: I suspect this is because there are no framework 4.0 handler mappings for .aspx files. However, aspnet_regiis even gives my admin user the finger and says I need admin rights to run it.

EDIT #2: I registered all the frameworks (2 & 4, 32 and 64) and all now works. I found this by manually adding a script map for .aspx to aspnet_isapi and voila. I don't understand why the installation of the framework doesn't do this, unless my memory fails me and I only enabled IIS after installing VS.

asp.net Solutions


Solution 1 - asp.net

Maybe too late now, but more often than not you need to run

aspnet_regiis.exe -i  

after installing asp.net. Maybe I would do it anyway now.

Solution 2 - asp.net

In addition to above, if you need WCF support, you might need to run this:

c:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe -i

Replace v3.0 to whatever your current framework version is.

Solution 3 - asp.net

I encountered this error from IIS 8.5 when trying to access a WCF service I had written. Turns out the server didn't have the WCF HTTP Activation features turned on. Checked the boxes and clicked through the wizard, iisreset, started working.

Windows Features Panel

Solution 4 - asp.net

If you are using iis 7.5.

Just go to IIS Manager, open your website properties.

You will see 'Handler Mappings' section there, just go to that section and Search for 'staticFile'.

Most probably its a last file in the list.

Then Right Click on it and Select 'Revert To Parent'.

I have wasted so many hours while i have faced this first time, anyways this will solve your problem.

Solution 5 - asp.net

I had this issue with Windows Server 2012 with ASP .NET 4.5 you can't use aspnet_regiis.exe, and just have to install ASP .NET 4.5 via the Add Roles and Features Wizard:

enter image description here

You can find the menu item "Add Roles and Features" in the menu "Manage", in the right corner of Server Manager

Solution 6 - asp.net

alt text

should check out this option i suppose

Solution 7 - asp.net

I solved this problem by enabling WCF Services

Programs and Features > NET Framework 4.5 Services > WCF Services> HTTP Activation node

But you have to admit it guys this ENTIRE IIS setup configure/guess/trial and see/try this/try that spends 4 or 5 of our days trying to find a solution around approach IS A COMPLETE AND UTTER JOKE.

SURELY, 'IIS' IS THE BIGGEST CONFIDENCE TRICK EVER PLAYED ON MANKIND TO DATE

Solution 8 - asp.net

I know this is an old question, but I've just had this with a 3.5 application on my rebuilt Windows 8 machine and I was still getting this after aspnet_regiis -iru and it turned out the be ASP.NET 3.5 wasn't ticked within Application Development Features (not enough reputation to post an image).

Solution 9 - asp.net

There is a chance that application pool created for you application by default is version 2. So although you see a handler for .svc extension in the list it does not work and treat it as static file. All you need is to open application pool properties and switch it to version 4.

Solution 10 - asp.net

Register asp.net again....will solve the issue.
enter image description here

Go to Visual Studio Command Prompt,
And register asp.net as windows\microsoft.net\Framework[.Net version num]\aspnet_regiis.exe -i

Solution 11 - asp.net

I had this same issue on a windows 8 machine I am setting up. I had installed vs2012 before vs2010, which installs .NET framework 4.5. I have my app pools running in 4.0. I made sure I had aspnet registered for 4.0 using aspnet_regiis -i. That still didn't do the trick. Then I opened up the Windows Features and noticed that 4.5 added a set called ".NET Framework 4.5 Advanced Services". I enabled the WCF Service node and its children and then my svc endpoint operated correctly. Hope this helps folks who are making the move to Windows 8.

Solution 12 - asp.net

For Windows 10/Framework 4.7, I had to turn on HTTP Activation through the following method:

  1. Control Panel > Programs and Features > Turn Windows Features on or off
  2. Under .NET Framework 4.7 Advanced Services, expand WCF Services, select to check the HTTP Activation and whatever else you need when working with WCF
  3. Click OK and let the install do its thing, then open an administrative command prompt and issue the IISRESET command

Solution 13 - asp.net

I stumbled upon this question when I ran into the same issue. The root cause of my issue was an incorrectly-configured app pool. It was set for 2.0 inadvertently, when it needed to be set to 4.0. The answer at the following link helped me uncover this issue: http://forums.iis.net/t/1160143.aspx

Solution 14 - asp.net

cmd -> right click -> Run as administrator

C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i

Solution 15 - asp.net

For other people reading this:

This can happen is if the .Net version that you have registered isn't the one selected under the 'Basic Settings' of the application pool attached to your website. For instance, your sites application pool has .Net v2.0 selected but you registered v4.0

Solution 16 - asp.net

Just another possible solution I found having the same error message.

When trying to setup a .NET 4.0 web application to a new applicition pool I was receiving this strange error telling me it was trying to process my aspx file with the static file handler, which didn't make sense.

For some reason the ISAPI for .NET 4.0 was set to disabled in the ISAPI and CGI Restrictions area of the server level in the IIS manager. Setting it to enabled was all that was required, however the IIS 7.5 manager is so convoluted and hard to follow it took me a long time to figure this out.

I'm guessing that since it was a 4.0 Application that could not be processed by the 4.0 Engine the static file handler was being used by default.

Solution 17 - asp.net

I had the same problem. When I added Static content feaute for IIS, It works fine.

Solution 18 - asp.net

it could be multiple reason, in my case under Application pool->advance setting->Enable 32 bit application (should be true).It was set to false before.

Solution 19 - asp.net

Using IIS manager, I found that .aspx files were mapped (under "Handler Mappings") to ISAPI 2.0 - even though ASP.NET 4.5 had been previously installed. Editing them to point (also) to an executable for ISAPI 4.0 64bit fixed the issue.

The executable was found in %windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll

Solution 20 - asp.net

i received this message for an application on iis 7.5 with a classic app pool assigned to .net 2.0. i needed to go to Handler Mappings and add two script maps, both were the same with except for the name. one name was svc-ISAPI-2.0-64, the other was svc-ISAPI-2.0. The request path was .svc. And the Executable was %SystemRoot%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll. i restarted iis and all was happy

Solution 21 - asp.net

One of the worst case scenario I just solved is - having conflicting entry in Web.config.

On my local machine I didn't had .woff extension registered in IIS, so I added it using Web.config. But on production server .woff had mime type registered. This caused application level conflict.

Funny part is there are no error logged for this. Just a guess work (first time of course).

So for me solution was just to remove and/or elements from web.config.

Solution 22 - asp.net

I had the same issue, I just changed the target framework version on the website to the version it is developed in,Same in IIS. This solved my problem. Hope this helps...

Thank You

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionProfKView Question on Stackoverflow
Solution 1 - asp.netRemyView Answer on Stackoverflow
Solution 2 - asp.netAdiView Answer on Stackoverflow
Solution 3 - asp.netJ T RView Answer on Stackoverflow
Solution 4 - asp.netKumarView Answer on Stackoverflow
Solution 5 - asp.netC. Augusto ProieteView Answer on Stackoverflow
Solution 6 - asp.netJsinhView Answer on Stackoverflow
Solution 7 - asp.netRichardView Answer on Stackoverflow
Solution 8 - asp.netbicbmxView Answer on Stackoverflow
Solution 9 - asp.netKonstantin SalavatovView Answer on Stackoverflow
Solution 10 - asp.netSunilView Answer on Stackoverflow
Solution 11 - asp.netIceNineView Answer on Stackoverflow
Solution 12 - asp.netWill BuffingtonView Answer on Stackoverflow
Solution 13 - asp.netGarrison NeelyView Answer on Stackoverflow
Solution 14 - asp.netSafaa ElgendiView Answer on Stackoverflow
Solution 15 - asp.netb15View Answer on Stackoverflow
Solution 16 - asp.netDarrenMBView Answer on Stackoverflow
Solution 17 - asp.netjasharbnView Answer on Stackoverflow
Solution 18 - asp.netmadhurView Answer on Stackoverflow
Solution 19 - asp.netMatthew DigginsView Answer on Stackoverflow
Solution 20 - asp.netRobertView Answer on Stackoverflow
Solution 21 - asp.netAshishView Answer on Stackoverflow
Solution 22 - asp.netArjunView Answer on Stackoverflow