404.17 error - requested content appears to be script - asp.net

I have a similar question to this one;
IIS 7.5
Server 2008
ASP.Net 4.0 web site
The error I get when trying to run the site is this:
HTTP Error 404.17 - Not Found
The requested content appears to be script and will not be served by the static file handler.
...
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 hander.
Now here comes the weird part:
THE WEIRD PART
The weird part is that on the develop server -- which is similar in every aspect to the production server -- everything runs smoothly.
Here's a list of things I cannot try, because I don't want to mess with the sever (it hosts many other sites):
Reinstalling .Net
Reinstalling IIS
Reinstalling anything
Running aspnet_regiis
Here's what I did try:
Republishing the site
Restarting the application pool
Changing the application pool to .Net 2.0 and back to .Net 4.0
Switching around between Integrated and Classic pipeline mode
Enabling 32-bit mode
Taking a look at Handler Mappings
Eventually I created a new application pool, and it sort of started working.
Q) "Sort of"?
A) Yes, sort of.
Now the site only works when the (new) app pool is set to .Net 4.0, Integrated,
and the site's Authentication has ASP.NET Impersonation set to Disabled.
Any change to these settings sets the server yelping "404.17" all over again.
Q) What's wrong with that?
A) What's wrong with that is that I NEED ASP.NET Impersonation for the site to function properly.
As always, your guidance is most needed.

HTTP Error 404.17 - Not Found
The requested content appears to be script and will not be served by the static file handler.
Usually this error occurs when you have the right IIS version installed to the respective .net framework. If it was a version (not installed) issue then you would have got a different error message. Anyways, I think by now you have resolved your matter, but I like to share some words with anyone else having this problem. These error messages gave me so much headache all last week and I had tried everything.
Best remedy is always to re install the latest .net in latest visual studio. And the important thing to do is uninstall the existing IIS(express or whichever you have) and re install it first. Then download the latest visual studio. This way visual studio installation can easily access you IIS and add the necessary application pool.
As for the error 404.17, it could simply be because the right application pool has not been assigned for the appropriate dot net version. If the right version is not there re installing visual studio is the only way I know. Also, I think you can try downloading another version of the Visual Studio too. For eg, download the ultimate if you have professional or vice versa. Hope this helps someone with similar problem.

Installing this windows server feature http activation is, what was missing for me.

Related

Local Host redirected you too many times Issue with IIS

I am working on bringing a working web application onto a new computer running Visual Studio 2022 version 17.4.2 and .NET Framework 4.7.2. When running on local IIS (version 10.0) host there is a "local host redirected you too many times" issue. It suggests clearing cookies which has been done with no effect.
The same code works on other machines with no issues. Is there anything in IIS set up/configuration or that may be missing from Visual Studio or other installations? Thanks in advance.
So far we have tried debugging the code and including breakpoints for where the issue may be occurring, ensuring that the installations of windows feature and IIS management is the same as another where the program is working. Also created a .txt file that can be reached on local host and is in same location as the rest of the project.
Here are a few things you can try:
Try on another machine.
Try to remove as much rules as possible from web.config and keys and so on. Or if it's a single page you're having the error with try to remove as much code from it especially if there are redirect codes. And add breakpoints and debug.
Check the LOCAL application pool version if it's set same as the online .net framework version.

How to add Default.aspx as default document

I have a new Windows Server 2016 with IIS 10.0.
I have a ASP.NET 4.6.2 application with a Default.aspx file.
When I point my browser to the application I get this error:
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
I suspect that IIS is not configured for ASP.NET because the Default Document does not include Default.aspx.
I have .Net Framework 4.6.2 as evidenced that I get an error message that is is already installed when I try to install it again.
The application pool lists CLR 4.0, but does not allow me to change it to 4.6.2.
What do I try to get this configured to load my Default.aspx.
When I google I stumble on things that tell me to run stuff from the command line. I am perfectly comfortable running things from the command line but what I am doing is do vanilla that I can't believe I need to do something from the commandline.
[EDIT] Here is what happened when I added Default.aspx as a default document:
There are a few things to try, but all the instructions are a bit to vague for me to follow with confidence. It also seems weird that I would have to run a commandline thing for something so common as getting IIS to use ASP.NET.
[EDIT] Here are the settings for the Default page:
[EDIT] Here is the configuration of the Application Pool:
After going down all kinds of wrong paths I found this link:
https://learn.microsoft.com/en-us/iis/get-started/whats-new-in-iis-8/iis-80-using-aspnet-35-and-aspnet-45
which amounted to getting 4.6 checked on this wizard screen and pressing install. It was confusing because this is under the development category and this is not a development machine.
Note: the hand added Default.aspx caused a conflict so I had to remove it from web.config by hand.
you can see below link where you can find your answer.
https://www.c-sharpcorner.com/UploadFile/francissvk/set-default-page-for-a-website-in-iis421/

IIS 8.5 throwing 404.3 errors for ASPX pages

I just installed IIS 8.5 on Windows 8.1. I installed it after installing Visual Studio 12 and the 4.5 version of the .NET framework. I created a new site and now I am getting this error:
HTTP Error 404.3 - Not found
The page you are requesting cannot be served because of the extension configuration.
I have seen posts here and elsewhere regarding this error and none of the fixes have worked. I have tried running aspnet_regiis.exe - the correct 64 bit version. I have also installed all the ASP.NET development tools, including the .BET 4.5 Extensibility feature. Still I am getting this error. I haven't found a post yet with a fix I have not tried.
Has anyone fixed this issue a different way?
I know that this question is old but I've managed to solve this issue on Windows Server 2012 without reinstalling anything, so just in case I leave my solution for future reference:
I just went to 'Add roles and features' and in the Features part I checked 'HTTP activation' on '.Net Framework 4.5 Features->WCF Services'.
The solution turned out to be quite simple. I removed IIS completely, rebooted, and installed it again, making sure to include all the Asp.NET development features the second time.
I think that's where I went wrong the first time. I installed IIS without those features and tried to add them in later. It seems like that should work, but it didn't. The total re installation did, though.
404.3 is the MIME type restriction, it means the server is not serving files with an .aspx extension. That's okay, it is not suppose to. But it has to be defined under the Handler Mappings like this:
If there entries are not there, add them.
On IIS 8.5, Open Server Manager, navigate to the Server Roles screen Scroll down the list to the "Web Server (IIS)" --> "Web Server" and check all the options under "Application Development". That should work!

Visual Studio .NET has detected that the specified Web server is not running ASP.NET 1.1

ok, I'm stumped.. yes, I've googled already and this time, it seems it is the first time that google failed me.
I have an ASP .Net Web Application project (acquired from a predecessor who loves brute algorithms and redundancies in his codes) and was trying to open it in a VS .NET 2003 where it was developed (well, actually not on the same machine where it was developed.) The project is a part of a larger solution composed of other VB projects. When I first opened the inherited solution some era ago, I found that an error prevented me from opening the said web project... I just ignore it then because the project wasn't that important before. Now that the project needs to be maintained, I think it's time for me to get my hands dirty with it.
This is my first time opening a web application project so I expected that there will be something wrong:
Visual Studio .NET has detected that the specified Web server is not running ASP.NET 1.1. You will be unable to run ASP.NET Web applications or services.
Right. With the use of a trusty Google, I have tried my efforts on the following (but as I have said, this time, she failed me):
Uninstall .NET framework 1.1
Reinstall .Net framework 1.1
Followed KB 306005 which says about: aspnet_regiis.exe -i
Tried the switches -u, -ua, -c and -enable for aspnet_regiis.exe
Restarted IIS
Deleted the folder for framework 1.0
rebooting and/or retrying between the items above, but I still get the same error.
There's another thing I tried, changing the path of the project in the .sln file using notepad. I changed the word "localhost" to my IP address but it produced another error saying that it can't open the project and that the web does not exist.. it asked me to try another file share path. No joy there.
I noticed that by accessing the address http://192.168.2.138/MyWebProject/main.aspx in a browser, the web page looks ok (that's my IP, btw). But the http://localhost/MyWebProject/main.aspx doesn't work and gives the message: No web site is configured at this address.
I'm using XPProSP3 with updates of Oct 2010; I have .Net Framework 2.0 SP2, 3.0 SP2, 3.5 SP1 installed together with 1.1; Latest SP for 1.1 is KB979906.
I think that I'm just missing something that needs to do before making a ASP .Net web project.. :D
I like to open the project in my VS but I'm stumped. How can I open it?
I knew I am missing something above. I was able to pass through the error today by doing the following:
Uninstalled IIS 5.1
Reboot
Reinstalled IIS 5.1
Do aspnet_regiis -i of the installed version 1.1.4322
Reboot
Tried making a new ASP.NET web app and I was able to make one.
Tried opening the file in my post above and it gave a new error:
Unable to get the project file from the web server.
Well, that's a new error for me, another story and I think there's no point of continuing this thread because the title says so. I have to move on and continue to discover how to open this file. ;)
Good day.
Change the webside address to nothing or add localhost to it (in site properties in IIS). Alternatively in project properties switch to builtin asp.net webserver.
If you can visit the site on one URL, but not another (and both point to the same computer) then most likely it is a problem with the web server configuration. Both hostnames are not bound to that solution/folder. It CAN be a firewall issue. Try temporarily disabling the local firewall.
The access logs from IIS and the Event Log are valuable resources in troubleshooting such issues.

Script not served by static file handler on IIS7.5

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.
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.
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.
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.
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.
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:
You can find the menu item "Add Roles and Features" in the menu "Manage", in the right corner of Server Manager
should check out this option i suppose
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
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).
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.
Register asp.net again....will solve the issue.
Go to Visual Studio Command Prompt, And register asp.net as windows\microsoft.net\Framework[.Net version num]\aspnet_regiis.exe -i
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.
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
For Windows 10/Framework 4.7, I had to turn on HTTP Activation through the following method:
Control Panel > Programs and Features > Turn Windows Features on or off
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
Click OK and let the install do its thing, then open an administrative command prompt and issue the IISRESET command
cmd -> right click -> Run as administrator
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i
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
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.
I had the same problem. When I added Static content feaute for IIS, It works fine.
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.
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
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
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.
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

Resources