Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 533
regeme Avatar asked Mar 25 '13 18:03

regeme


3 Answers

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.

like image 117
Ravindra Gullapalli Avatar answered Oct 07 '22 00:10

Ravindra Gullapalli


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.

like image 39
Shashank Avusali Avatar answered Oct 07 '22 00:10

Shashank Avusali


+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

like image 39
Hainan Zhao Avatar answered Oct 06 '22 23:10

Hainan Zhao