HTTP Error 403.14 - Forbidden IIS Error for ASP.Net MVC 4 Application
Asked Answered
I

13

28

we developed an asp.net mvc 4 application. in vs 2012 this work fine. we publish this web application and putting it on iis 7.5, but when we want to browse web application through iis, this error message was show:

HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.

we think that this error may be from this web application, but we create another asp.net mvc 4 application (without any change and with internet template) and putting it on iis, and again top error show to us.

we search in the internet and see more poeples that this problem was happened for their. for example in this: 403 - Forbidden on basic MVC 3 deploy on iis7.5 link introduce an idea for solve this problem and assume that this problem was solved for their poeple, but this solution not work for me. another links that we say includes: this https://stackoverflow.com/questions/6885509/http-error-403-14-forbidden and this: http://yassershaikh.com/http-error-403-14-forbidden-the-web-server-is-configured-to-not-list-the-contents-of-this-directory/ but this solutions not work for me

any idea for solve this problem?

Ide answered 10/3, 2013 at 14:15 Comment(5)
Can you check if asp.net is installed on the server and IIS application pool is using the correct version?Spinode
from where i can find out that asp.net is installed? application pool is set to v4.0Ide
i add this comment that other asp.net web form application that write in vs 2010 are in this iis and work correctlyIde
Ok, VS2012 by default sets the targetframework to 4.5. Can you check what is the TargetFramework in your vs2012 solution? Your server might be missing installation of 4.5.Spinode
Possible duplicate of HTTP Error 403.14 - Forbidden The Web server is configured to not list the contentsNorthamptonshire
I
8

an update for IIS is solved my problem, that can be downloaded from below link: http://support.microsoft.com/kb/980368

Ide answered 18/6, 2013 at 16:27 Comment(1)
Fixed my issue, too. Thank you!Yasmineyasu
D
42

I had the same problem on a brand new machine, after installing IIS 7.5, Visual Studio etc. I ended up refreshing ASP.NET registration and it worked.

C:\windows\Microsoft.NET\Framework64\v4.0.30319> .\aspnet_regiis.exe -ir C:\windows\Microsoft.NET\Framework64\v4.0.30319> iisreset

HTH

Disloyal answered 10/4, 2013 at 20:37 Comment(3)
This also fixed it after an upgrade from IIS 6 to 7 on a windows server 2008. Thanks!Wilma
If trying to install ASP.NET 4.5 on IIS8, this command will not work. It will point you to the following kb for the correct command to use: "dism /online /enable-feature /featurename:IIS-ASPNET45" support.microsoft.com/kb/2736284Luciolucita
@Luciolucita You sir are the chairman!!! I have ben banging my head for hours! I used the /all option "dism /online /enable-feature /featurename:IIS-ASPNET45 /all"Heyes
C
12

First You should register the framework for IIS by executing following command in command prompt as

C:\windows\Microsoft.NET\Framework\v4.0.30319> aspnet_regiis.exe -i C:\windows\Microsoft.NET\Framework64\v4.0.30319> aspnet_regiis.exe -i

If you still get an error as


HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory


Then probably you need an update for IIS which is used when URLs do not end with a period

Please visit the following link for update http://support.microsoft.com/kb/980368

An update is available that enables certain IIS 7.0 or IIS 7.5 handlers to handle requests whose URLs do not end with a period

Collete answered 12/12, 2013 at 8:2 Comment(1)
Oh I always forget this one! It solved my problem this time. Thanks!Hols
I
8

an update for IIS is solved my problem, that can be downloaded from below link: http://support.microsoft.com/kb/980368

Ide answered 18/6, 2013 at 16:27 Comment(1)
Fixed my issue, too. Thank you!Yasmineyasu
T
7

This happened to me because I mistakenly ran an unrelated search and replace that renamed the 'id' parameter (3rd line) in Global.asax.cs:

            routes.MapRoute(
               "Default", // Route name
               "{controller}/{action}/{id}", // URL with parameters
               new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults

...to another name. I immediately started getting 403.14 locally and remotely. Changing it back to 'id' fixed it.

Thetic answered 7/6, 2013 at 15:38 Comment(2)
Be sure to check XxxxAreaRegistration classes in your Areas if you're using that feature, too.Thetic
In my case, it also was a rename of "id" to something else; however, this statement was found in RouteConfig.cs (and was the source of the problem.)Bouffard
B
5

Open Elevated Command Prompt in Windows (Run command prompt as Administrator).

And run the command aspnet_regiis -i at the .Net Framework and .Net Framework64 location. Just like below, Here parameter i means install the ASP.NET version 4. The first command is for 32 bit and second is for installing the 64bit version.

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

ScreenshotCommandPrompt

The commands is used to register ASP.NET applications with Internet Information Services (IIS) server.

Baldheaded answered 3/6, 2015 at 12:53 Comment(0)
L
3

Perhaps... If you happen to use the Publish Wizard (like I did) and select the "Precompile during publishing" checkbox (like I did) and see the same symptoms...

Yeah, I beat myself over the head, but after unchecking this box the, seemingly unrelated setting, all the symptoms described go away.

Hopefully this fixes some folks.

Llewellyn answered 9/4, 2014 at 18:45 Comment(1)
In my case, I was able to get the same error to go away by selecting the "Precompile during publishing" option, where it previously was not. I only tried because it was seemingly unrelated. I wonder if it invalidates a build cache or something?Fully
O
2

It sounds like the application is not correctly configured. Ensure that your web.config has been deployed, along with all of your application files and that the application pool is configured correctly.

If you access the machine running IIS directly you will likely get a more detail error message.

Omnidirectional answered 10/3, 2013 at 14:18 Comment(2)
yes, web config is deployed. and application pool is set to v4.0. this is local machineIde
In my case the web.base.config and all the transforms were deployed instead of the transformed web.config.Microeconomics
C
2

I would comment on @Seth's answer if I had 50 rep. It's not just a search and replace problem. There is a Refactor --> Rename Bug in Visual Studio 2012 that wrongly renamed the "id" inside the literal string value of the url parameter in my RouteConfig.cs. Of course, it's resolved as "won't fix", so be warned.

routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{id}",
            defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
        );

was changed to

routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{replaced_text}",
            defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
        );
Cottar answered 18/12, 2013 at 16:25 Comment(0)
M
1

In my case the problem was with the Physical Path setting.

It was pointing to C:\inetpub\wwwroot\MySite

but the imported site was actually at C:\inetpub\wwwroot\MySite\Default Web Site\MySite

I changed the path in iis via MySite -> Edit Site -> Basic Settings and I was off to the races.

Metropolitan answered 4/12, 2014 at 2:16 Comment(1)
So Silly, my site was pointing to another empty folder too :(Spancake
D
0

Had the same error (403.14) after copying a working ConnectionString from my web.config on a newer project to replace the ConnectionString on an old project then started doing testing on localdb and received the error. Note: I copied, from new web.config to old web.config, the connectionString portion of the connectionstring only and did not make any changes to the name or providername on the old project. After researching for several hours finally went into one of the attached sqldatasources on the old project (on the design tab in VS 2012) and re-configured the sqldatasource (clicked "configure data source") and in the first dropdown box selected the name associated with one of the recently copied ConnectionStrings. That was all it took to get going and after reconfiguring the ConnectionString it started working. Suspect that when I copied over the ConnectionString from the new project to the old project that the default table specified in the sqldatasource assignment process might have been lost?

Ddt answered 27/1, 2015 at 18:10 Comment(0)
G
0

You need to change application pool for the site:

  • Go to "Actions" panel
  • Then select "Basic Settings"
  • On "Application pool" choose "Select ..."
  • Finally ASP.NET v4.0
Garboil answered 26/2, 2016 at 16:34 Comment(0)
O
0

I had the same error but none of the above solutions worked for me, it ended up that i had .Net 4.6 installed on my development machine, but the project was targeting .net 4.5. I couldn't understand the reason as to why this happened, but nonetheless this thing worked for me.

Olwen answered 2/4, 2016 at 19:2 Comment(0)
U
0

In my case Default Web Site was mapped to a different application. When I was trying to access my app inside Default Web Site I got the 403.14 error.

The solution was to remap Default Web Site to default C:\inetpub\wwwroot.

Unshapen answered 10/5, 2016 at 14:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.