The requested content appears to be script and will not be served by the static file handler.IIS 7.5
Asked Answered
S

10

15

I know there are related posts here on this forum and another resources but I got stuck with this and couldnt proceed.Problem is i've done a website with vs2010 when i publish it to ftp server and navigate to url adress I got this error. Here the things that i've done

-I've enabled IIS services and static content

-I've revert to parent the staticFile under handler mappings

-I've registered the asp.net again in command prompt(the regiis.exe thing)

-In IIS manager i've added my website adress under sites, stopped default web site and started mine.

-I've added my site to classic.NET AppPool(integrated,and v4.0)

-I've enabled the default browsing..

-I've done all the advices that generally covered..

Here is my web.config

<configuration>
<system.webServer>
<directoryBrowse enabled="true" showFlags="Date, Time, Size, Extension" />
<defaultDocument>
  <files>
    <add value="AnaSayfa.aspx" />
  </files>
</defaultDocument>
</system.webServer>
<system.web>
<compilation debug="true" targetFramework="4.0" />

</system.web>
 </configuration>

where am I doing mistake? I've spent 2 days and couldnt proceed an inch.I will burst into tears if this problem solved.Any help will be greatly,greatly,greatly! appreciated,will be my hero,master (: thanks

Southwest answered 25/3, 2013 at 18:52 Comment(1)
I know is an old post, but I had the same problem but it was related to not having ASP.NET 3.5 installed. I only had ASP.NET 4.5. Worked fine after the install.Primavera
S
23

Go to Command Prompt and install / repair ASP.NET

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

Go to IIS => Select the Server Name (System Name)

Go to ISAPI and CGI restrictions

Allow the Not Allowed restrictions.

Siliculose answered 13/6, 2013 at 11:16 Comment(2)
On windows 8 (and apparently server 2012 though that doesn't apply to me) the command line tool doesn't work stating it isn't supported on this version of windows. It refers to go.microsoft.com/fwlink/?LinkID=216771 as instructions for how to install/repair asp.net for iis.Rotherham
Thank you very much. You saved me a few hours of wasted timeOptometer
A
6

I got this working when i change the app pool's .Net framework version to my application's .net framework version. My application's framework version was 4.0 but app pool's setting was defaulted to 2.0. I had to change it to 4.0, then it worked fine.

Anthurium answered 18/4, 2014 at 14:43 Comment(3)
Changing the app pool to CLR 4 changes the error message to "There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined"Caffrey
For missing WCF support, windows server 2012, try thisCaffrey
check out this #3387822Anthurium
M
2

+1 with @Dablue, IIS 8.5 does not support the aspnet_regiis command anymore. For me, the issue is resolved by installing the "Asp.Net 3.5" or "Asp.Net 4.5" under Web Server > Application Development.

enter image description here

Mule answered 11/6, 2018 at 3:6 Comment(0)
C
1

@regeme - I was experiencing a similar problem when trying to run my own site and after a lot of digging I finally resolved it. In my case it was related to a *.json file trying to be loaded and no rules being initialized for it. If you look closer at your error it should give you an idea of what it is IIS is not loading.

After looking at the web inspector's network tab I was able to see which items were returning 404's they were all *.json.

I'm assuming since your error is returning a "content appears to be script and will not be served by the..." it is the same case.

My resolution:

A) It is possible you have already done this as it would throw another error, I'm just covering our bases.

  1. Go to IIS HTTP Response Headers
  2. create a mime-type ".json" "application/json"

B) **SEE NOTE

  1. Go to Handler Mappings.
  2. Set Request Path: to "*.json"
  3. Executable: to "C:\Windows\System32\inetsrv\asp.dll"

C) You may want to restart your service at this point again just to be safe this can be done in the IIS panel or cmd prompt.

  1. Windows key + r
  2. type: cmd and hit ctrl+shift+enter
  3. type: iisreset and hit enter

*NOTE: This may save you a lot of headache, in my case I installed the 64 bit dll of asp.dll instead of the 32 bit version the folder for the 64-bit version is in C:\Windows\SysWOW64\inetsrv\asp.dll

IMPORTANT these file locations are in windows 8 and to my understanding are the same in windows 7 but this may not be the case for your OS double check.

Lastly if you are missing the asp.dll this is simply because you are missing windows features. Simply go to add/remove programs (Programs and Features)

  1. Turn Windows features on or off
  2. drop down Internet Information Services
  3. drop down World Wide Web Services
  4. check Application Development Features make sure it's not just a partial check and that all sub-items are being installed
Critical answered 4/4, 2013 at 21:30 Comment(0)
G
1

On Windows 2012 and IIS 8.5 aspnet_regiis is no longer valid.

Instead, add the aspnet-4.5 rolefrom within server manager

Open server manager in the left column select IIS Scroll the right window until you see "Roles and Features" Tasks select Add roles Under "server roles" open "Web Server (iis) open "Web Server" open "application development" Select "ASP.NET 4.5" (the "asp.net 4.5 extensibility" will not do it)

Gourami answered 25/5, 2015 at 12:49 Comment(0)
R
0

We got the same issue when hosting our MVC application on the web server. All the applications were working fine except the WCF service.

It was resolved, when we added a server role for .NET Framework 4.5 WCF service in Windows Server Manager.

Visit http://community.bamboosolutions.com/blogs/bambooteamblog/archive/2013/02/08/how-to-enable-and-use-net-framework-3-5-and-4-5-in-windows-server-2012.aspx

Rapport answered 16/6, 2016 at 4:27 Comment(1)
Hi Dilini, welcome to SO and thanks for your answer. To help protect against future link rot, could you please add the relevant parts of this solution to your answer?Neocene
U
0

For me the issue was fixed by right click on Virtual directory-->convert to application

Unhallow answered 25/6, 2016 at 16:20 Comment(0)
E
0

Check out this, in my case this solved the problem

https://support.microsoft.com/en-us/kb/2019689

This might help you

In this case, a 404.17 error is returned if the *.aspx resource being requested from the site is handled in an Application pool that is not running in Classic Mode, is not 32 bit, or is not running the 2.0 version of the .NET Framework. In order for the resource to be served correctly in this example, all 3 pre-conditions must be met. Specifically, the application pool hosting this resource would have to be configured for Classic Mode, it would need to be configured to use the 2.0 version of the .NET Framework, and it would need to be set for 32 bit applications.

Edward answered 6/7, 2016 at 14:4 Comment(0)
B
0

I had to create a new Web Site. There was some invalid configuration in my Website level that referenced my application's virtual directory directly.

For example, https://server/app gives me the 404.17 error but https://server/app-test works successfully. Swapping the two application names (using appcmd) caused the working app-test (now renamed to app) to begin failing. After creating a new Web Site named MyApp Web Site I was able to again create a new app, this time named app that worked successfully.

After extensive review of Default Web Site we cannot identify what configuration is causing 404.17 for apps named app and not alternatively named apps like app-test.

I believe the ultimate cause of this, is I did not have .NET Extensibility Services and ASP.NET 4.5 added through the server roles and features—During installation. Thus, the installer of my app failed to successfully configure Default Web Site correctly. For example, the created app pool incorrectly installed with v2.0 Integrated and not v4.0 Integrated. After installing the required roles and features I verified ISAPI (64 bit v4) was configured correctly, and the App Pool was appropriately configured for v4 Integrated. Unfortunately, I cannot identify any additional settings that would cause this issue—especially explicitly targeting the app virtual path.

Borkowski answered 18/12, 2021 at 20:26 Comment(0)
P
0

This solved the issue for me. +1 to all who spoke a reasonable solution without having to pass through a 3 ring circus.

Turn on IIS Windows Features like these

IIS App Dev Features related to ASP.NET

Pinchhit answered 26/1, 2022 at 20:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.