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

南笙酒味 提交于 2019-11-27 19:04:01

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

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

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

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.

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

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

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.

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.

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 }
        );

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.

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?

ArthurAkhmerov

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

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!