I just created a new empty website in Visual Studio 2012 and clicked on run (i.e view in browser) and I get this error :
HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory.
I went into IIS and clicked on Directory browsing and then ensured that Directory browsing was enabled but I still get this error. I can't figure it out ?
The website project I just created is not listed in Default web sites in IIS Manager which I thought was odd.
How do I get rid of this error ?
view
in a browser?
keep this into your web config file then rename the add value="yourwebformname.aspx"
<system.webServer>
<defaultDocument>
<files>
<add value="insertion.aspx" />
</files>
</defaultDocument>
<directoryBrowse enabled="false" />
</system.webServer>
else
<system.webServer>
<directoryBrowse enabled="true" />
</system.webServer>
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. To resolve this problem, I followed the steps in Method 1 as mentioned in the MS Support page and its the recommended method.
Method 1: Enable the Directory Browsing feature in IIS (Recommended)
Start IIS Manager. To do this, click Start, click Run, type inetmgr.exe, and then click OK. In IIS Manager, expand server name, expand Web sites, and then click the website that you want to modify. In the Features view, double-click Directory Browsing. In the Actions pane, click Enable.
If that does not work for, you might be having different problem than just a Directory listing issue. So follow the below step,
Method 2: Add a default document
To resolve this problem, follow these steps:
Start IIS Manager. To do this, click Start, click Run, type inetmgr.exe, and then click OK.
In IIS Manager, expand server name, expand Web sites, and then click the website that you want to modify.
In the Features view, double-click Default Document.
In the Actions pane, click Enable.
In the File Name box, type the name of the default document, and then click OK.
Method 3: Enable the Directory Browsing feature in IIS Express
Note This method is for the web developers who experience the issue when they use IIS Express.
Follow these steps:
Open a command prompt, and then go to the IIS Express folder on your computer. For example, go to the following folder in a command prompt: C:\Program Files\IIS Express
Type the following command, and then press Enter: appcmd set config /section:system.webServer/directoryBrowse /enabled:true
Go to cmd and type this:
for x64 O.S: %windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -ir
for x32 O.S: %windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -ir
This will install the right version and IIS will understand the MVC directory browsing
There can be multiple reasons for the issue. One that worked for me on IIS 8.5 was as follow
Steps
Type "turn windows features on or off" in search. Click on "Add Roles and features" in Server Manager. In Wizard scroll down to the Web server and select : Web Server -> Application Development. Select all except CGI from the list as shown in the screen shot
https://i.stack.imgur.com/UgsIG.png
Finally hit next and Install. Restart IIS
Your website may start working.
I just pasted this code snippet inside web.config file and the error was solved.
<system.webServer>
<directoryBrowse enabled="true" />
</system.webServer>
Set a start page.
When I had this problem, I went into the solution explorer, found the page I wanted to see first (in my case "Home.aspx), right clicked on it and selected "Set As Start Page." This fixed my issue (which sounded really similar to yours). This was in Visual Studio 2012 Professional and I ran it in Firefox.
Try to add the following settings to web.config
file.
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
Control Panel > Turn Windows Features on or off
Internet Information Services > World Wide Web Services > Application Development Features
Enable the two options
.NET Extensibility 3.5 .ASP.NET 3.5
https://i.stack.imgur.com/fjAAu.png
https://i.stack.imgur.com/Frl1x.png
I don't know whether this solution will help others.
On the site in IIS:
select 'Advance Settings' Then for application pool choose "ASP.NET v4.0"
https://docs.kentico.com/download/attachments/11272485/image2013-3-26%2012%3A40%3A38.png?version=1&modificationDate=1368524937706&api=v2
Empty website template creates an ASP.NET website that includes a Web.config file but no other files. Means you have not any default page to show on browse or run.
This error message simply means that you did not setup and configure the default document properly on your IIS.
Once this is configured, the error message will go away.
I solved my problem with fallow this steps =>
Open IIS Manager Click the Application Click Directory Browsing Click Open Feature (On the right you will see under Actions) Click Enable
Problem
Error: 403.13 when running WebForms ASP.Net website from Visual Studio.
Solution
Access to the root is denied: http://localhost:51365
Navigate to the Login page or any page that exists and it will work:
http://localhost:51365/Login.aspx
For my case, I received the same error after creating an empty Web Api project.
I solved it by editing RouteConfig.cs in the App_Start folder :)
I replaced the line of code reading :-
defaults: new { action = "Index", id = UrlParameter.Optional }
with the following :-
defaults: new { controller = "Index", action = "Index", id = UrlParameter.Optional }
Notice I just had to specify the Controller whose index action I would like to invoke first.
Well all the above responses didn't solve my case (as I wanted) e.g.
Enabling directory browsing from web.config just listed all files and folders in my project just like php would do when you don't have an index file
Setting defaultDocument also didn't work for me somehow still got the HTTP Error 403.14 (Still have no idea why)
If there may be anyone in similar circumstances as mine then give this a try.
I was getting this error and change the Application Pool Managed Pipeline Mode to "Integrated" solves the problem.
Source: Running a .NET 4.6 MVC application on IIS 8.5 (Windows Server 2012)
In my case, I experienced this error because my webapp was .NET v4, and the application pool was configured for .NET v2.
Double-clicking on the application pool brings up a popup window, where we can select the desired version of .NET Framework.
https://i.stack.imgur.com/P0XtC.png
The problem may come from running the project from visual studio on IIS while being on the wrong opened tab on visual studio, so the solution is either opening the right tab (the webform you want to test on your browser) or as others suggested in the other answers, right click on the webform that you want to set as a homepage then click on 'Set As A Start Page'.
This can be caused by a bum applicationhost.config entry.
Stop IIS Express if it's running (right-click the light-blue scroll-thingy icon in the Windows System Tray; Exit).
Go to your project's Properties > Web, and check that the Project Url is correct. In case of an https url, make sure it includes a port number in the valid range. A correct URL could be: https://localhost:44300/
. Now press the "Create Virtual Directory"-button next to the URL. This adds a new entry to applicationhost.config.
Start the project again and hopefully you will no longer get the error.
I'm sure after years you probably have an answer already. But in case someone else is looking for an answer in the future.
For my problem, I didn't have to at anything to the web.config. I didn't think I would need to either as it was working previously.
Make sure no folder is named the same as your page, I had a folder called "blog" and a page named "blog.aspx", it was trying to load the folder, I noticed this in the link, changed the folder to blogContent, now it loads fine.
I'm posting a copy here as you're the first in the search query.
In my case
In Application Pool i set .NetFrameWork version to V4.0 and solved problem ....
https://i.stack.imgur.com/ukOuH.png
In my case I was missing the Microsoft.Owin.Host.SystemWeb
nuget.
right click on your project in solution explorer and then click add new item, add a HTML page and name it as index.HTML after all rerun your application
This could happen for any number of reasons. If you have tried through all of the above and still getting the same error, I have one more solution.
Another reason this could happen is that
If you have the same code base running before you started to run the fresh solution, you might encounter this error. The reason is that IIS Express is trying to run on the same port as it was for the old solution which has the physical path registered for the application start URL. Since the IIS cannot figure out the physical path to run the solution, it might not be able to locate all the dlls required to start the application.
Solutions:
Try to change the application port to default. For example., Use http://localhost/ instead of http://localhost:25836/ Try changing to any other port if you have already used the default port for the previous application. ex: http://localhost:25364/ instead of http://localhost/
This will allow the IIS/IIS Express to point to the default bin path of the newer application you are trying to run which will have all the required dlls to start the application.
I open one old Asp.net webform (.Net Framework4.5)solution with Visual Studio 2019, has same issue. The solution quite simple, go to web project's properties-> Web-> checked "Override application root URL" -> assign another port number. Save the solution and run in debug mode again. Problem resolved.
So this means the server can't process what you doing. (if you wanna use the index kinda thing ignore this answer)
For example, if you are instaling WordPress on windows iis, the server should be able to run .php files.
otherwise you will get these kinds of issues. So if it WordPress you can resolve that issue by installing PHP on that server using iis manager -> web platform installer.
https://i.stack.imgur.com/Vt6yY.png
Success story sharing