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

asp.net MvcIis

asp.net Mvc Problem Overview


I have downloaded the MVC Music Store ASP.NET application at location C:\Users\DEVESH\Desktop\Projects\MvcMusicStore-v3.0\MvcMusicStore-Completed\MvcMusicStore and added the website on IIS at the same location. I have also given permission to IIS_IUSRS, but when I run localhost I am getting the error:

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

I have googled it, but have not found a fix. What I am doing wrong?

asp.net Mvc Solutions


Solution 1 - asp.net Mvc

I came across this error because I had the wrong .NET version (v2.0 instead of v4.0) configured on the web site application pool. I fixed it this way on Windows Server 2008 R2 and IIS 7. I'm pretty sure the instructions apply to Windows Server 2012 and IIS 8 as well:

  • Press keys Windows+R to open the Run dialog, type inetmgr and then click OK. This opens the IIS Manager.
  • In the left treeview, locate the Sites node and find the Default Web Site node under it (or the name of the site where the error message appears).
  • Right-click the node and select Manage web site -> Advanced settings.... Note the name of the value Application pool. Close this dialog.
  • In the treeview to the left, locate and select the node Application pools.
  • In the list to the right, locate the Application pool with the same name as the one you noted in the web site settings. Right-click it and select Advanced settings...
  • Make sure that the .NET Framework version value is v4.0. Click OK.

This doesn't apply if you're running an older site that actually should have .NET v2.0, of course :)

Solution 2 - asp.net Mvc

In my case ASP.NET not registered on server. try to execute this in command prompt:

Windows 32bit

%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -ir

Windows 64bit

%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -ir 

Solution 3 - asp.net Mvc

Just in case if anyone reached here looking for solution, here is how i resolved it. By mistake I deleted all files from my server ( bin directory ) but when i recopied all files i missed App_global.asax.dll and App_global.asax.compiled files. Because these files were missing IIS was giving me this error

403 - Forbidden: Access is denied.

As soon as i added these files, it started working perfectly fine.

Solution 4 - asp.net Mvc

I resolved this issue by correcting an error with my Global.asax file arrangement. I had copied across the files from another project and failed to embed the Global.asax.cs within the Global.asax file (both files previously existed at the same level).

Global.asax arrangement

Solution 5 - asp.net Mvc

In my case when I browsed to site5.com I got the following error.

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

Most likely causes: A default document is not configured for the requested URL, and directory browsing is not enabled on the server.

And then when I browsed to

site5.com/home/index

I was met with

HTTP Error 404.0 - Not Found The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

Most likely causes: The directory or file specified does not exist on the Web server. The URL contains a typographical error. A custom filter or module, such as URLScan, restricts access to the file.

All that I did is installed the feature in IIS ASP.NET 4.8 as shown below.

enter image description here

Solution 6 - asp.net Mvc

I was using ASP.NET 4.5 MVC application on IIS 7. My fix was to set runallmanagedmodule to true.

<system.webServer>
			<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>

or If you have other modules, you may want to add them inside the module tag.

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
             <add name="ErrorLogWeb" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
             ...
    </modules>
</system.webServer>

IIS Modules Overview : The Official Microsoft IIS Site

Solution 7 - asp.net Mvc

I have encountered similar myself before for 2 reasons;

  1. MVC is not installed.

  2. The url routing module is not registered (this varies by machine in my workplace for a reason I cannot fully explain - it is not always registered at a system level ), try registering it in the application web.config:

    ... ...

Edit: I forgot to add the location for iis 7+:

<system.webServer> 
       
      <modules> 
         ... 
         <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> 
      </modules>
</system.webServer>

Solution 8 - asp.net Mvc

This error can happen when, in IIS Manager, the ASP.NET MVC site is pointed to the wrong directory.

In my case, I inadvertently had the site pointed to the solution directory instead of the child project directory. That is, I had the site's Physical path set to

C:\dev\MySolution

instead of

C:\dev\MySolution\MyProject.

Specific steps to fix this:

  1. Open IIS Manager (Start > Run > inetmgr);
  2. In IIS Manager, in the left pane, expand Sites;
  3. Under Sites, left-click the ASP.NET MVC website;
  4. In the right pane, click Basic Settings...;
  5. In the Edit Site dialog, change the Physical path to the project directory.
  6. Click OK.

Solution 9 - asp.net Mvc

I've just had the same problem, but my fix was that the Routing was not configured in the Global.asax.cs file. I'm using Bootstrapper and Castle Windsor, so to resolve this problem I added the following code to Global.asax.cs:

public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            Bootstrapper.IncludingOnly.Assembly(Assembly.GetAssembly(typeof(WindsorRegistration)))
                .With
                .Windsor()
                .With
                .StartupTasks()
                .Start();
        }
    }

Obviously if you are using the basic MVC then you will need to reference the RouteConfig file in the AppStart folder instead:

public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
        }
    }

Solution 10 - asp.net Mvc

In my case, i had multiple projects but i had not defined the starting Project. So this error was generating. After defining the startUp project solved the issue.

Solution 11 - asp.net Mvc

Check this also:

This problem occurs because the Web site does not have the Directory Browsing feature enabled, and the default document is not configured. To resolve this problem, use one of the following methods:

  • Method 1: Enable the Directory Browsing feature in IIS (Recommended)
  • Method 2: Add a default document Method
  • Method 3: Enable the Directory Browsing feature in IIS Express

LINK : https://support.microsoft.com/en-us/kb/942062

Solution 12 - asp.net Mvc

This error occurs when the application cannot startup.
So the cause can be anything that prevents your application to start.

  • Wrong connection string
  • Wrong IIS directory permissions
  • An exception thrown in your Application_Start() function
  • IOC Container initialization error
  • IIS ASP.NET registration errors
  • Missing DLL in your bin folder
  • etc...

Solution 13 - asp.net Mvc

I had this error after creating an empty ASP.Net application in Visual Studio. As soon as I added a file index.html to the main solution, it worked. So in my case, I just needed to add a file to the root of the project folder.

Solution 14 - asp.net Mvc

I faced a similar (but not identical) issue.

I had to go to to Turn Windows features on or off in Control Panel and add ASP.NET 3.5 and 4.7: enter image description here

Then it worked for me.

Solution 15 - asp.net Mvc

If project is a ASP.net MVC project it would be about routing. In my case I changed default routing values:

routes.MapRoute(
           "Default",                                              
           "{controller}/{action}/{id}",                           
           new { controller = "Home", action = "Index", id = "" }  
       );

I changed my code accidentally to:

routes.MapRoute(
               "Default",                                              
               "{controller}/{action}/{JobID}",                           
               new { controller = "Home", action = "Index", id = "" }  
           );

Thats I only changed "id" to "JobId" and default route can not be find.

Solution 16 - asp.net Mvc

In my case index.aspx file was not created by default and after adding another web form i did not set the form as start page ...After setting the page as start page my issue get resolved . So right click a web form and set the form as start page :)

Solution 17 - asp.net Mvc

IUSR permissions use on a folder if not under inetpub/wwwroot will be solution for some.

Solution 18 - asp.net Mvc

In my case, I had to disable 'Exclude files from the App_Data folder' in my publish profile to deploy the App_Data folder with my XML documentation (XmlDocument.xml). That got rid of the 403.14.

Solution 19 - asp.net Mvc

in my case:

  1. in IIS Manager, in left tree, left click the computer name, in right dialog click ISAPI and CGT limitation, in open dialog, select ASP.NET v4.0.30319 and select enable. There is two ASP.Net v4.0, one for 32bit, another for 64 bit. select depending on your OS bit.
  2. in left tree select app pool, in right dialog, select the app pool your website used. double click that pool, in open dialog, .net framke item select .net framework v.4.0.30319. and pipe..item select integate. Maybe there is some wrong translation above because my OS is not English version.

Solution 20 - asp.net Mvc

In case anyone comes across this for a project other than MVC:

My project was a WCF project, which runs off .svc files--no default document. As a result I got a 403.14 error at myhost.com/ but as soon as I added a baseAddress path from my web.config file (ex. myhost.com/mybaseaddresspath.svc I got a webpage.

Solution 21 - asp.net Mvc

My colleagues made a URL Rewrite rule, which reduced all URLs to a StaticFileHandler; mapped to a file path at the root of my Application physical folder.

(i.e. an over-aggressive URL rewrite means that my Controllers/Actions were not working)

Check your applications' URL Rewrite rules to confirm they do what you expect.

Solution 22 - asp.net Mvc

I faced similar issue. My controller name was documents. It manages uploaded documents. It was working fine and started showing this error after completion of code. The mistake I did is - Created a folder 'Documents' to save the uploaded files. So controller name and folder name were same - which made the issue.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionF11View Question on Stackoverflow
Solution 1 - asp.net MvcDaniel PerssonView Answer on Stackoverflow
Solution 2 - asp.net MvcRuslan_KView Answer on Stackoverflow
Solution 3 - asp.net MvcATHERView Answer on Stackoverflow
Solution 4 - asp.net MvcLuke ZaparaniukView Answer on Stackoverflow
Solution 5 - asp.net MvcVivekDevView Answer on Stackoverflow
Solution 6 - asp.net MvcPriyank AgarwalView Answer on Stackoverflow
Solution 7 - asp.net MvcDavid BenningtonView Answer on Stackoverflow
Solution 8 - asp.net MvcJon SchneiderView Answer on Stackoverflow
Solution 9 - asp.net MvcJohnView Answer on Stackoverflow
Solution 10 - asp.net MvcrnsView Answer on Stackoverflow
Solution 11 - asp.net MvcBino Kochumol VargheseView Answer on Stackoverflow
Solution 12 - asp.net MvcHüseyin YağlıView Answer on Stackoverflow
Solution 13 - asp.net Mvclive-loveView Answer on Stackoverflow
Solution 14 - asp.net MvcEJoshuaS - Stand with UkraineView Answer on Stackoverflow
Solution 15 - asp.net MvcAhmet ArslanView Answer on Stackoverflow
Solution 16 - asp.net MvcAtiKa BhattiView Answer on Stackoverflow
Solution 17 - asp.net MvcTom StickelView Answer on Stackoverflow
Solution 18 - asp.net MvcSujay ParanjapeView Answer on Stackoverflow
Solution 19 - asp.net MvcPennyView Answer on Stackoverflow
Solution 20 - asp.net MvccodeMonkeyView Answer on Stackoverflow
Solution 21 - asp.net MvcThe Red PeaView Answer on Stackoverflow
Solution 22 - asp.net Mvcuser10922241View Answer on Stackoverflow