IIS 7.5, 8.0, 8.5 HTTP Error 403.14 - Forbidden after clean windows install - asp.net

I am running a Asp .Net website under IIS 7.5 - win 7, IIS 8.5 - win 8.1. I have 2 development machines witch run it normally.
Steps to recreate the environment
After a fresh install of Win 7 on another machine.
Installed all updates
Added IIS Feature with
.Net extensebility
Asp
CGI
ISAPI Extensions
ISAPI Filters
Registered .Net framework 4.0 with IIS(aspnet_regiis -i/aspnet_regiis -ir)
Added correct application pool to website.
Set the path to bin folder of the project.
in web.config set:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
Aded IIS/IIS_USRS read-Write rights on the specific folder
*Note: I do not need Directory Browsing enabled
The Problem
On all new OS Installs, no mater what win version (7, 8, 8.1, or 10 Preview) I got the same error
****HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.****
If anyone can help because I am running out of places to look for the problem.
*Note - Same setting work fine on 3 development machines with win 7 and server 2008.
If I deploy a Publish it works fine. (Containing .aspx pages)
Thank You

As I said in my comment below the OP I had tried everything on the list of usual suspects. After losing literally days of my life wrestling with this problem, this is what fixed it for me:-
For some reason best know to the malevolent forces of dotNet, publishing my web apps with the setting Precompile during publishing checked (found in the File Publish Options in the Settings tab of the publish dialog in VS 2012) caused certain of the MVC apps to use the wrong handler. It was almost as though IIS "forgot" they were MVC apps.
A small text file called:
PrecompiledApp.config
was created in the root directory of the malfunctioning app.
Deleting this text file and subsequently publishing without the pre-compile setting brought the malfunctioning apps back to normal!
I have not the faintest clue why this option should cause such a detrimental effect, but this seemed to be the cause.
(I also set all the references to the MVC dependencies as "copy local", but this is on the "usual suspect" list of things to do.)
As with most things dotNet related fixing such mysterious problems as these requires days of banging one's head against a wall randomly altering settings until one makes a difference. There is usually no logical reason for, or documented example of, the error in question, and you are just left with voodoo, hearsay and trawling sites like SO for an answer.
Gimme open source software any day...

On windows 8.1, IIS 8.5 i got the same error.
I googled and found this video:
https://www.youtube.com/watch?v=OmQlO0daduE&feature=youtube_gdata
My Default.aspx was Defeult.aspx with an a->e typeo - fixed it. And now it works.
Tho, I get it, it's still a strange error. Maby should have been something like - "Couldn't find any of the default start pages defined in 'Default Document' and with a - how to change link"

Related

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!

ASPX Page Not Found (Error 404), though it exists?

I have a C#.NET project and am having a problem with a single web forms, ASPX page when debugging my application. Most of my application works fine, but when I hit a particular page, I get an Error 404, resource not found. I don't understand this because the file does exist, and it exists in the path that is being referenced. And, I hit several other ASPX pages on the way to this one, without error.
Now, I should mention that this particular page was only recently added to the project. My coworker, who added the page, says he was able to get the page to work, but we have different environments. So, I'm sure that has something to do with it, but I don't know what. Below are the known details regarding the differences between our environments.
My environment
Windows 8.1
IIS Express
Visual Studio 2013
Co-workers environment
Windows 7
IIS 7
Visual Studio 2012
We are both running with the same source code, as well as the same site and application pool settings in IIS, which are pointed to run time 4.0 and in classic mode.
Does anyone here have any idea why this would happen, or what I might try to get past this?
I ended up fixing this by switching to local iis and enabling the Static Content option in Windows Features.

404.17 error - requested content appears to be script

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.

How to publish asp website using IIS7

I am trying to host my web application in IIS7 (for testing purposes). I have checked tutorials how to do it, they are very similar, but i always get some errors. I guess i'm missing something, hope you could help me.
Things that i have now:
1. Installed IIS7 with asp net (the IIS welcome image is showing, so i guess its installed correctly)
2. Simple web application (only with Default.aspx and some other automatically generated files)
I'm using tutorials like this one:
http://www.codeproject.com/Articles/28693/Deploying-ASP-NET-Websites-on-IIS-7-0
For those who may not want to click the link, here are the steps of this tutorial (just with mages and some additional info):
Step 1: From Visual Studio, publish your Web application.
Step 2: Copy the published application folder to "C:\intepub\wwwroot" [default] folder.
Step 3: From RUN - > inetmgr -> OK
"TestWeb" is a recently pasted webapplication on your wwwroot folder.
Step 4: We need to convert it to an application, just right click and then Click on "ConvertToApplication" as shown in the following picture:
+ How to create and assign application pools
Now about the errors i get when i'm trying to connect to the running Sample website:
1. If I'm using Framework 4.0 integrated application pool:
HTTP Error 500.21 - Internal Server Error
Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list
2. If I'm using Framework 4.0 Classic application pool:
HTTP Error 404.17 - Not Found
The requested content appears to be script and will not be served by the static file handler.
My guess is that something could be configured wrong in IIS7 or i might be publishing my web application not the way it has to be published, because they differ in tutorials that i am using. For now i am publishing, using File System option. Is it the right one for IIS7?
Hope anyone could explain me my mistakes.
Thanks, Walt
The answer for the questioner was to run the aspnet_regiis.exe -i from the framework directory
Below suggestions and comments leading to this answer :
I never had problems when publishing websites and webservices on IIS7 (for the moment) but I did a little research and according to the following link : http://forums.asp.net/post/3225843.aspx
It is suggested that after switching the AppPool to Classic .NET AppPool, it may be required for you to uncomment a section in the web.config which is necessary for IIS7
Did you try that ?
For number HTTP:500.21 check this asp.net forum
"Looks like you have not installed the asp.net feature from within IIS in "Add/Remove windows component" so that all the regstration needed to run asp.net is not present in your configuration." from the page.
For number 404.17 please check the asp.net module if properly installed or not. If not then you might have to install manually. Check this thread.

Resources