I have downloaded the MVC Music Store ASP.NET application at location C:UsersDEVESHDesktopProjectsMvcMusicStore-v3.0MvcMusicStore-CompletedMvcMusicStore
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?
Jon Schneider
24.9k21 gold badges144 silver badges167 bronze badges
asked Jul 13, 2013 at 14:42
1
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 🙂
answered Feb 17, 2014 at 20:12
![]()
Daniel PerssonDaniel Persson
2,1511 gold badge17 silver badges24 bronze badges
7
In my case ASP.NET not registered on server. try to execute this in command prompt:
Windows 32bit
%windir%Microsoft.NETFrameworkv4.0.30319aspnet_regiis.exe -ir
Windows 64bit
%windir%Microsoft.NETFramework64v4.0.30319aspnet_regiis.exe -ir
answered Jul 4, 2016 at 8:33
Ruslan_KRuslan_K
4157 silver badges23 bronze badges
4
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.
answered Aug 13, 2014 at 0:46
ATHERATHER
3,1395 gold badges39 silver badges61 bronze badges
0
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).

answered Aug 24, 2015 at 9:51
1
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.

answered Feb 22, 2020 at 10:09
VivekDevVivekDev
17.7k22 gold badges116 silver badges178 bronze badges
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
answered Apr 21, 2017 at 14:58
![]()
0
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:
<system.web>
...
<httpModules>
...
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</httpModules>
</system.web>
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>
answered Jul 13, 2013 at 15:37
![]()
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:devMySolution
instead of
C:devMySolutionMyProject.
Specific steps to fix this:
- Open IIS Manager (Start > Run > inetmgr);
- In IIS Manager, in the left pane, expand Sites;
- Under Sites, left-click the ASP.NET MVC website;
- In the right pane, click Basic Settings…;
- In the Edit Site dialog, change the
Physical pathto the project directory. - Click OK.
answered Jul 10, 2017 at 15:06
Jon SchneiderJon Schneider
24.9k21 gold badges144 silver badges167 bronze badges
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…
answered Dec 15, 2016 at 16:08
Hüseyin YağlıHüseyin Yağlı
9,6666 gold badges43 silver badges49 bronze badges
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:

Then it worked for me.
answered May 12, 2020 at 20:09
![]()
0
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);
}
}
answered Oct 21, 2015 at 13:47
![]()
JohnJohn
1,25816 silver badges25 bronze badges
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.
answered Jan 7, 2016 at 15:01
rnsrns
1432 silver badges7 bronze badges
0
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.
answered Jan 4, 2017 at 15:10
![]()
live-lovelive-love
46.1k22 gold badges226 silver badges196 bronze badges
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
answered Nov 10, 2016 at 10:23
![]()
BinoBino
60417 silver badges21 bronze badges
2
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.
answered May 9, 2016 at 14:55
![]()
Ahmet ArslanAhmet Arslan
4,9621 gold badge31 silver badges34 bronze badges
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
🙂
answered May 12, 2017 at 17:08
IUSR permissions use on a folder if not under inetpub/wwwroot will be solution for some.
answered Feb 20, 2018 at 22:42
![]()
Tom StickelTom Stickel
19.2k6 gold badges110 silver badges113 bronze badges
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.
answered Jan 5, 2018 at 21:06
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.
answered Jan 26, 2018 at 0:33
![]()
PennyPenny
5861 gold badge6 silver badges15 bronze badges
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.
answered Feb 5, 2019 at 17:38
codeMonkeycodeMonkey
3,8222 gold badges34 silver badges49 bronze badges
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.
answered May 9, 2019 at 23:44
The Red PeaThe Red Pea
16.6k18 gold badges95 silver badges127 bronze badges
I faced the same issue while developing Business Central application.
Open Business Central Application and Edit Web Client Base URL
under Client Services.
You can enter http://localhost:8080/YourWebServerInstance/

answered Sep 19, 2022 at 19:03
MeliMeli
314 bronze badges
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.
answered Jan 16, 2019 at 11:59
0
- Remove From My Forums
-
Question
-
User1255309776 posted
Hi,
I published my project ForOffer to web hosting server using Web deployment method via Visual Studio 2017. I’ve entered all server details and publish was successful. (see
https://prnt.sc/n1tlmb) .from my side (in Visual Studio)
But when it opens the page error : 403 Forbidden comes. What might cause this? What I need to check and edit before publishing?
Answers
-
User1255309776 posted
It finally worked. The problem was that hosting provided didn’t give me the full server name (with port), the server name they gave me today included a port number which helped to connect to database.
Thank you guys for all your comments and info.
-
Marked as answer by
Thursday, October 7, 2021 12:00 AM
-
Marked as answer by
In a previous post, you learned how to troubleshoot 401 – Unauthorized: Access is denied due to invalid credentials. In this post, we will cover how to troubleshoot HTTP Error 403.14 – Forbidden in Internet Information Services (IIS).
Contents
- HTTP Error 403.14 – Forbidden
- Cause of error
- Resolving the error
- Directory browsing is not enabled
- Enable directory browsing using the IIS Manager
- Default document is not configured
- ASP.NET is not installed on the server
- Common 403 substatus codes
- Conclusion
- Author
- Recent Posts
![]()
Surender Kumar has more than twelve years of experience in server and network administration. His fields of interest are Windows Servers, Active Directory, PowerShell, web servers, networking, Linux, virtualization, and penetration testing. He loves writing for his blog.
![]()
Latest posts by Surender Kumar (see all)
- Backup in Proxmox VE — Thu, Jan 26 2023
- Snapshots in Proxmox VE — Wed, Jan 25 2023
- Create a Windows VM in Proxmox VE — Fri, Jan 13 2023
HTTP Error 403.14 – Forbidden

HTTP Error 403.14 Forbidden
The HTTP Error 403.14 – Forbidden is displayed when you try to access a website hosted on IIS having detailed errors enabled. As you can see in the screenshot, the error page says The Web server is configured to not list the contents of this directory and also indicates the most likely causes of this error.
If the detailed errors are not enabled, you will see a custom error page with a generic message: 403 –Forbidden: Access is denied.

403 Forbidden Access is denied
Cause of error
As indicated by the detailed error page, there are three likely causes of this error:
- Directory browsing is not enabled—Directory browsing is the ability of a web server to list the contents of the website’s root directory in a web browser. The following screenshot shows what a website looks like when directory browsing is enabled:

What a website looks like in a browser when directory browsing is enabled
As you can see in the screenshot, directory browsing enables visitors to view files and browse through the directories. The chances are pretty slim that you want your website to look like this.
- Default document is not configured—The default document is a file that is served by the web server when the client does not specify a particular file in a uniform resource locator (URL). By default, web server software recognizes file names such as default.htm, default.html, default.aspx, index.html, index.htm, etc. The following screenshot shows a list of default documents supported by IIS:

Viewing the default document for a website in the IIS Manager
To add a custom default document (e.g., awesomehome.html), click Add and then type the name of the default document. You could even change the order of documents by selecting one and then clicking the Move Up or Move Down options in the Actions pane on the right.
- The ASP.NET feature is not installed on the server—The default documents, such as aspx and index.html, only work with websites that use traditional frameworks. With modern frameworks and programming technologies such as MVC, the default pages are defined and handled right inside the application code by the developers. So, if your website is using MVC or a similar technology, you need to install the ASP.NET feature on the server. See how to install ASP.NET on the web server.
Resolving the error
We covered the possible causes of this error in the previous section. Now, depending on your scenario, you could try the following steps to fix this error:
Directory browsing is not enabled
If you know that your website should list the contents of the root directory so that visitors can browse the files and folders, you need to enable the Directory Browsing option, using either the IIS Manager or the web.config file.
Enable directory browsing using the IIS Manager
Open the IIS Manager, select your website, and then double-click the Directory Browsing option under IIS in Feature view.

Viewing the directory browsing feature in the IIS Manager
Now click Enable in the Actions pane on the right.

Enabling directory browsing using IIS manager
Enable directory browsing using the web.config file
If you’re using a shared hosting server, you could enable directory browsing using the web.config file itself:
Open the web.config file and paste the following code between the <system.webServer> and </system.webServer> tags:
<directoryBrowse enabled="true" />

Enable directory browsing using the web.config file
Default document is not configured
If your website uses a traditional framework and you see a file with a name such as default.aspx, index.html, or index.php in the website’s root directory, make sure the same filename is also available in the list of default documents. You could even ask the developer about the name of the default document for your website. For instance, I know that my website is supposed to use home.html as the default document. Therefore, I will add it either using the IIS Manager or the web.config file. See the following screenshots for reference:

Adding a default document for the website using the IIS Manager

Adding a default document to a website using the web.config file
ASP.NET is not installed on the server
If neither of the above solutions works, it is likely that your website is using MVC or a similar technology that requires the ASP.NET development feature on the server, and it is not currently installed. This error is common when you try to host an MVC website on a web server for the first time. To install ASP.NET, use the following PowerShell command:
Install-WindowsFeature Web-Asp-Net45 -IncludeAllSubFeature
This command installs ASP.NET 4.5 or higher on the web server, and your MVC website will start working.
If your website is supposed to use a legacy version of ASP.NET (e.g., 3.5 or below), use the following command instead:
Install-WindowsFeature Web-Asp-Net -IncludeAllSubFeature

Installing ASP.NET on a web server using PowerShell
Common 403 substatus codes
The following table covers some common HTTP 403 substatus codes, along with their possible causes and troubleshooting advice:
Subscribe to 4sysops newsletter!
| Status Code | Possible Cause | Troubleshooting Advice |
| 403.1 | Execute access is forbidden | This error indicates that the appropriate level of the execute permission is not granted. To resolve this error, make sure the application pool identity has the execute permission. |
| 403.2 | Read access is forbidden | This error indicates that the appropriate level of the read permission is not granted. To resolve this error, make sure the application pool identity has the read permission. |
| 403.3 | Write access is forbidden | This error indicates that the appropriate level of the write permission is not granted. To resolve this error, make sure the application pool identity has the write permission. |
| 403.4 | An SSL connection is required | This error indicates that the request was made over a nonsecure HTTP channel but the web application is configured to require an SSL connection. |
| 403.13 | The client certificate has been revoked | This error indicates that the client browser tried to use a certificate that was revoked by issuing certificate authority. |
| 403.14 | The directory listing is denied | We covered how to fix this error above. |
Conclusion
The key to troubleshooting any IIS-related error is to enable the detailed errors. When the detailed errors aren’t helpful in revealing the actual HTTP status and substatus codes, you could use Failed Request Tracing to understand what’s going on with the HTTP request. I hope you find this post helpful.
I’m developing an ASP MVC web project. Now I have a requirement which forces me to deploy to an IIS7 inmiddle of development (to check some features). I’m getting the above mentioned error message whenever I try to type the URL of the web site. (Note: development machine: Vista Home Premium, IIS7)
What I have done until now:
Edited the HOSTS file (C:WINDOWSsystem32driversetchosts).
Put two domains in it (127.0.0.1 domain1.com & 127.0.0.1 domain2.com).
Created a folder c:websitesdirOfApplication and deployed from within Visual Studio 8 to this folder.
In IIS7 created a new site with host name domain1.com and application folder the above.
Typing the address domain1.com in Web browser results in the above error (HTTP Error 403.14 — Forbidden — The Web server is configured to not list the contents of this directory.)
I think I’m missing something but don’t know what! Tryed to deploy the files System.Web.Mvc, System.Web.Abstraction & System.Web.Routing wit the same outcome. Whenever I try to hit F5 and run the application, it works fine!
![]()
psubsee2003
8,4838 gold badges62 silver badges79 bronze badges
asked Nov 16, 2009 at 10:53
savvas sopiadissavvas sopiadis
1,6842 gold badges12 silver badges11 bronze badges
1
Maybe it’s useful to someone:
After converting my app to MVC 4 with .NET framework 4.5 and installing the framework on my server with IIS 7.0 I encountered the same ‘forbidden’ error mentioned in the question. I tried all options described above to no avail, when I noticed the
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
was missing from my web.config.
After adding this, everything worked. Simple, but easy to overlook…
EDIT:
Of course the solution above will work, but it is indeed a waste of resources. I think it is better to add the routing module as pointed out by Chris Herring in the comments.
<system.webServer>
<modules>
<remove name="UrlRoutingModule-4.0" />
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
</modules>
</system.webServer>
answered Jun 14, 2012 at 8:43
Cyril MestromCyril Mestrom
5,8624 gold badges19 silver badges27 bronze badges
4
Answered on SO here, question: 403 — Forbidden on basic MVC 3 deploy on iis7.5
Run aspnet_regiis -i. Often I’ve found you need to do that to get 4.0 apps to work. Open a command prompt as an Administrator (right click the command prompt icon and select Run as Administrator):
cd
cd WindowsMicrosoft.NETFrameworkv4.xxx.xxx
aspnet_regiis -i
Once it has installed and registered, make sure you application is using an application pool that is set to .NET 4.0.
UPDATE: I just found an issue with this command. Using -i updated all application pools to ASP.NET 4.0.
Using aspnet_regiis -ir installs the version of ASP.NET but does not change any web applications to this version. You may also want to review the -iru option.
answered Jul 13, 2011 at 21:10
6
I too ran into this error. All the configuration and permissions were correct.
But I forgot to copy Global.asax to the server, and that’s what gave the 403 error.
answered Sep 16, 2012 at 19:59
0
It’s because of being too sure about what you (me) are doing!
On my machine there is IIS 7 installed but the required ASP.NET component (Control Panel->Programs->Turn On/Off->ASP.NET) was not.
So installing this solved the problem
Greg Gum
31.4k34 gold badges151 silver badges213 bronze badges
answered Nov 16, 2009 at 12:01
savvas sopiadissavvas sopiadis
1,6842 gold badges12 silver badges11 bronze badges
1
I had the same issue. This Microsoft support article fixed it for me.
https://support.microsoft.com/en-us/help/2023146/mvc-2-and-asp.net-4-web-forms-applications-that-use-url-routing-might-return-http-404-errors-when-they-attempt-to-process-extensionless-urls-on-iis-7-and-iis-7.5
In the «Turn Windows Features On or Off» dialog box of the Windows Control Panel «Programs and Features» application, perform the following steps:
- Navigate to the following node: Internet Information Services —> World Wide Web Services —> Common HTTP Features
- Make sure that the «HTTP Error Redirection» option is selected.
-or-
- Navigate to the following node: Internet Information Services —> World Wide Web Services —> Performance Features
- Make sure that the «Static Content Compression» option is selected. After either option has been selected, click «OK» to save changes.
Re-enabling either the HTTP Error Redirection module or the Static Content Compression module ensures that ASP.NET and IIS correctly synchronize HTTP pipeline events. This enables the URL routing module to process extensionsless URLs.
answered Mar 28, 2011 at 12:49
![]()
Donny V.Donny V.
21.8k13 gold badges64 silver badges79 bronze badges
In my case following approach helped me out:
-
aspnet_regiis -iinWindowsMicrosoft.NetFramework -
Adding modules to system.webServer
<system.webServer> <modules runAllManagedModulesForAllRequests="true"/> ... </system.webServer>
![]()
NathanOliver
167k28 gold badges279 silver badges387 bronze badges
answered Apr 5, 2013 at 15:30
Stefan MichevStefan Michev
4,6563 gold badges34 silver badges30 bronze badges
1
Try to apply the following settings shown below:
1) Give the necessary permission to the IIS_IUSRS user on IIS Server (Right click on the web site then Edit Permissions > Security).

2) If you use .NET Framework 4, be sure that .NET Framework version is v4.0 on the Application Pool that your web site uses.

3) Open Commanp Prompt as administrator and run iisreset command in order to restart IIS Server.
Hope this helps…
answered Dec 28, 2016 at 14:21
![]()
Murat YıldızMurat Yıldız
10.9k6 gold badges62 silver badges62 bronze badges
1
Please also check, if you are running x64, that you have enabled 32-bit applications in the app pool settings

answered Jul 28, 2011 at 21:47
![]()
On the Uncheck «Precompile During Publishing» — I was getting the 403.14 error on a web service I had just written in VS2015 so I rewrote it in VS2013 and was getting the same error. In both cases I had «Precompile During Publishing» on. I unchecked it but was still getting the error. In my case I also had «Delete all existing files prior to publish» but was not deleting everything from the target directory on the server before copying the new published files there. If you don’t do that — a «PrecompiledApp.config» file is left behind which causes the problem. Once I deleted that file I was golden on both the VS2013 and VS2015 versions of my web service.
answered Aug 6, 2015 at 20:48
JTTxJTTx
572 bronze badges
I read through every answer here looking for something that worked before I realized that I’m using IIS 10 (on Windows 10 version 2004) and this question is about IIS 7 and almost a decade old.
With that said, run this from an elevated command prompt:
dism /online /enable-feature /all /featurename:IIS-ASPNET45
The /all will automatically enable the dependent parent features: IIS-ISAPIFilter, IIS-ISAPIExtensions, and IIS-NetFxExtensibility45.
After this, you’ll notice two new (in my environment at least) application pool names mentioned .NET v4.5. ASP.NET web apps that were previously using the DefaultAppPool will just work.

answered Dec 14, 2020 at 22:14
If the top answers don’t work, look for a config named PrecompiledApp.config in the hosting directory and delete it if it exists. This file prevents IISExpress and LocalIIS to work properly. (And I think that’s a bug) The content of the file in my case was:
<precompiledApp version="2" updatable="true"/>
And I’m 100% positive that was the problem with my case since I tried everything in 2 hours and tested lots of times with this config.
One more thing: You cannot use aspnet_regiis in newer versions of Windows and IIS so try
dism /online /enable-feature /featurename:IIS-ASPNET45 /all
answered Jan 14, 2017 at 11:37
sotnsotn
4,2302 gold badges28 silver badges30 bronze badges
Control Panel > turn windows features on or off > Web Server > Application Development
Check ASP.NET
answered Feb 6, 2020 at 22:50
![]()
Please note sometimes wrong Managed pipeline mode will cause this error. There are two choices to select integrated and classic.
answered Jan 22, 2013 at 12:44
Joe.wangJoe.wang
11.3k25 gold badges102 silver badges178 bronze badges
How to Fix “HTTP Error 403.14 – Forbidden The Web server is configured to not list the contents of this directory”
This error occurs when you have MVC 2+ running hosted on IIS 7+, this is because ASP.NET 4 was not registered in IIS. In my case I was creating a MVC 3 project and hosting it on IIS 7.5.
To fix it, make sure you have MVC 2 or above and .Net Framework 4.0 installed, then run a command prompt as administrator and type the following line:
32bit (x86)
%windir%Microsoft.NETFrameworkv4.0.30319aspnet_regiis.exe -ir
64bit (x64)
%windir%Microsoft.NETFramework64v4.0.30319aspnet_regiis.exe -ir
brimble2010
17.6k7 gold badges27 silver badges44 bronze badges
answered Jan 17, 2015 at 6:16
![]()
Vishal SenVishal Sen
1,1151 gold badge13 silver badges23 bronze badges
0
Check your Global.asax file.
In my case, it was empty.
answered Dec 7, 2016 at 13:08
![]()
oyenigunoyenigun
5676 silver badges15 bronze badges
I tried everything here; nothing worked. Problem was in my Web.config file, somehow dependent assembly binding got changed from minimum 1 to minimum 0.
<!-- was -->
<runtime>
<assemblyBinding>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
<!-- should have been -->
<bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
answered Apr 6, 2017 at 8:11
codeMonkeycodeMonkey
3,8222 gold badges34 silver badges49 bronze badges
NOTHING WORKED IN THE WORLD FOR ME,
I found out the problem and this might be helpful for someone,
Applicable if you are using Plesk, I just turned this thing off and everything started to work.
Yet, I do not know what is the exact issue with it.

answered Aug 25, 2020 at 9:47
Adel MouradAdel Mourad
1,26816 silver badges12 bronze badges
1
I have also encountered this same error, despite all the provided solutions for the following reasons:
- Missing DLLs
- Database connection string points to an inaccessible server.
answered Dec 11, 2011 at 3:55
eulerfxeulerfx
36.2k5 gold badges59 silver badges82 bronze badges
In my case web.config and all files except for the /bin folder were missing (not copied somehow).
Silly, but that was the last thing I have checked.
answered Sep 3, 2012 at 16:49
eitanpoeitanpo
3441 silver badge10 bronze badges
I recently had this error and found that the problem was caused by the feature «HTTP Redirection» not being enabled on my Windows Server. This blog post helped me get through troubleshooting to find the answer (despite being older Windows Server versions): http://blogs.msdn.com/b/rjacobs/archive/2010/06/30/system-web-routing-routetable-not-working-with-iis.aspx for newer servers go to Computer management, then scroll down to the Web Server role and click add role services
answered Jan 28, 2013 at 14:00
SephSeph
8,36410 gold badges61 silver badges93 bronze badges
I’m using: Win Server 2012 R2 / IIS 8.5 / MVC4 / .Net 4.5
If none of the above worked then try this:
Uncheck «Precompile during Publishing»
This kicked my butt for a few days.
answered May 7, 2015 at 17:06
![]()
D. KermottD. Kermott
1,55315 silver badges22 bronze badges
1
With ASP.NET project with C# 4.5 I’ve solved such problem by installing ASP.NET extension in Web Platform Installer
answered Jul 9, 2015 at 13:34
Also one more things can be possible
install .net framework 4.0 manually
This solution is for IIS7 on window 7
open cmd with administration previleges
go to directory «C:WindowsMicrosoft.NETFrameworkv4.0.30319»
type aspnet_regiis.exe -i
got to your inet manager by typing in run command «inetmgr»
refresh your IIS7
reload the site.
answered Jul 19, 2016 at 8:07
I know you had this problem in an internal host, but I had experienced such an issue before in an external host and in my case it had it’s own resolution, maybe it could save somebody’s time:
In fact my website was STOPPED by some reason which currently I’m not aware of, to check it out if you have the same problem, in WebsitePanel main page go to Web -> Websites then select the domain name of your website from the list, after that in the right side of the page just opened, check if you see the word STARTED, else if you see the word STOPPED, make it get started again. That’s all.
answered Jul 22, 2017 at 12:53
![]()
Muhammad MusaviMuhammad Musavi
2,3742 gold badges21 silver badges35 bronze badges
I know this is an old topic, but you can also get this error (when you are debugging) if you have a folder named the same as a route in a controller.
For instance, if you have a UserController, with a route called /User and you ALSO have a folder in your solution called «User» then IISExpress will try to browse the folder instead of showing your view.
answered May 30, 2018 at 22:55
![]()
After trying every solution suggested here, I found yet another possible solution: URLScan
The IIS had WebDAV disabled, even in the web.config of my application, WebDAV’s handler and module was removed. PUTs still returned a 403 — Forbidden without any log entries in the IIS logs. (GET / POST worked fine).
Turns out the IIS had an active ISAPI Filter (the URLScan) enabled which prevented all PUTs. After removing URLScan, it worked for me.
answered Feb 7, 2019 at 13:53
My situation was completely different than any of these and the 403:Forbidden error message was a little bit of a red herring.
If your Application_Start() function in the Global.asax module tries to access the web.config and an entry that it’s referencing isn’t there, IIS chokes and (for some reason) throws the 403:Forbidden error message.
Double-check that you aren’t missing an entry in the web.config file that’s attempting to be accessed in your Global.asax module.
answered Sep 16, 2019 at 18:03
![]()
Jason MarsellJason Marsell
1,7222 gold badges19 silver badges10 bronze badges
In case you’re like me and have an application using NHibernate and the above answers have not resolved your issue.
You should look at the connection string in your application; possibly in the webconfig file to ensure it is correct.
answered Sep 24, 2019 at 18:33
![]()
wale Awale A
811 silver badge7 bronze badges
I have been using Identity Impersonate:
<system.web>
<identity impersonate="true" userName="domainusername" password="password"/>
</system.Web>
When pushing up to the server you have to give the username access to the Temporary ASP.NET Files folder so it can read/write/execute properly:
C:WindowsMicrosoft.NET"frameworkversion""aspversion"Temporary ASP.NET Files
Obviously replace «frameworkversion» and «aspversion» with the versions you are using.
answered May 13, 2014 at 9:40
dalemacdalemac
3551 gold badge4 silver badges15 bronze badges
Step 1: Select the Site For which the HTTP Error is produced in IIS and then click on Directory Browsing as shown in the image below:
Step 2: In the Directory Browsing Window in IIS click on Enable in Actions on the right side as shown in the diagram below:
Now Directory Browsing is enabled for your asp.net website, just restart the web application in IIS and Browse the site in your browser and see the result.
answered Jul 30, 2014 at 21:05
I’m developing an ASP MVC web project. Now I have a requirement which forces me to deploy to an IIS7 inmiddle of development (to check some features). I’m getting the above mentioned error message whenever I try to type the URL of the web site. (Note: development machine: Vista Home Premium, IIS7)
What I have done until now:
Edited the HOSTS file (C:WINDOWSsystem32driversetchosts).
Put two domains in it (127.0.0.1 domain1.com & 127.0.0.1 domain2.com).
Created a folder c:websitesdirOfApplication and deployed from within Visual Studio 8 to this folder.
In IIS7 created a new site with host name domain1.com and application folder the above.
Typing the address domain1.com in Web browser results in the above error (HTTP Error 403.14 — Forbidden — The Web server is configured to not list the contents of this directory.)
I think I’m missing something but don’t know what! Tryed to deploy the files System.Web.Mvc, System.Web.Abstraction & System.Web.Routing wit the same outcome. Whenever I try to hit F5 and run the application, it works fine!
![]()
psubsee2003
8,4838 gold badges62 silver badges79 bronze badges
asked Nov 16, 2009 at 10:53
savvas sopiadissavvas sopiadis
1,6842 gold badges12 silver badges11 bronze badges
1
Maybe it’s useful to someone:
After converting my app to MVC 4 with .NET framework 4.5 and installing the framework on my server with IIS 7.0 I encountered the same ‘forbidden’ error mentioned in the question. I tried all options described above to no avail, when I noticed the
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
was missing from my web.config.
After adding this, everything worked. Simple, but easy to overlook…
EDIT:
Of course the solution above will work, but it is indeed a waste of resources. I think it is better to add the routing module as pointed out by Chris Herring in the comments.
<system.webServer>
<modules>
<remove name="UrlRoutingModule-4.0" />
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
</modules>
</system.webServer>
answered Jun 14, 2012 at 8:43
Cyril MestromCyril Mestrom
5,8624 gold badges19 silver badges27 bronze badges
4
Answered on SO here, question: 403 — Forbidden on basic MVC 3 deploy on iis7.5
Run aspnet_regiis -i. Often I’ve found you need to do that to get 4.0 apps to work. Open a command prompt as an Administrator (right click the command prompt icon and select Run as Administrator):
cd
cd WindowsMicrosoft.NETFrameworkv4.xxx.xxx
aspnet_regiis -i
Once it has installed and registered, make sure you application is using an application pool that is set to .NET 4.0.
UPDATE: I just found an issue with this command. Using -i updated all application pools to ASP.NET 4.0.
Using aspnet_regiis -ir installs the version of ASP.NET but does not change any web applications to this version. You may also want to review the -iru option.
answered Jul 13, 2011 at 21:10
6
I too ran into this error. All the configuration and permissions were correct.
But I forgot to copy Global.asax to the server, and that’s what gave the 403 error.
answered Sep 16, 2012 at 19:59
0
It’s because of being too sure about what you (me) are doing!
On my machine there is IIS 7 installed but the required ASP.NET component (Control Panel->Programs->Turn On/Off->ASP.NET) was not.
So installing this solved the problem
Greg Gum
31.4k34 gold badges151 silver badges213 bronze badges
answered Nov 16, 2009 at 12:01
savvas sopiadissavvas sopiadis
1,6842 gold badges12 silver badges11 bronze badges
1
I had the same issue. This Microsoft support article fixed it for me.
https://support.microsoft.com/en-us/help/2023146/mvc-2-and-asp.net-4-web-forms-applications-that-use-url-routing-might-return-http-404-errors-when-they-attempt-to-process-extensionless-urls-on-iis-7-and-iis-7.5
In the «Turn Windows Features On or Off» dialog box of the Windows Control Panel «Programs and Features» application, perform the following steps:
- Navigate to the following node: Internet Information Services —> World Wide Web Services —> Common HTTP Features
- Make sure that the «HTTP Error Redirection» option is selected.
-or-
- Navigate to the following node: Internet Information Services —> World Wide Web Services —> Performance Features
- Make sure that the «Static Content Compression» option is selected. After either option has been selected, click «OK» to save changes.
Re-enabling either the HTTP Error Redirection module or the Static Content Compression module ensures that ASP.NET and IIS correctly synchronize HTTP pipeline events. This enables the URL routing module to process extensionsless URLs.
answered Mar 28, 2011 at 12:49
![]()
Donny V.Donny V.
21.8k13 gold badges64 silver badges79 bronze badges
In my case following approach helped me out:
-
aspnet_regiis -iinWindowsMicrosoft.NetFramework -
Adding modules to system.webServer
<system.webServer> <modules runAllManagedModulesForAllRequests="true"/> ... </system.webServer>
![]()
NathanOliver
167k28 gold badges279 silver badges387 bronze badges
answered Apr 5, 2013 at 15:30
Stefan MichevStefan Michev
4,6563 gold badges34 silver badges30 bronze badges
1
Try to apply the following settings shown below:
1) Give the necessary permission to the IIS_IUSRS user on IIS Server (Right click on the web site then Edit Permissions > Security).

2) If you use .NET Framework 4, be sure that .NET Framework version is v4.0 on the Application Pool that your web site uses.

3) Open Commanp Prompt as administrator and run iisreset command in order to restart IIS Server.
Hope this helps…
answered Dec 28, 2016 at 14:21
![]()
Murat YıldızMurat Yıldız
10.9k6 gold badges62 silver badges62 bronze badges
1
Please also check, if you are running x64, that you have enabled 32-bit applications in the app pool settings

answered Jul 28, 2011 at 21:47
![]()
On the Uncheck «Precompile During Publishing» — I was getting the 403.14 error on a web service I had just written in VS2015 so I rewrote it in VS2013 and was getting the same error. In both cases I had «Precompile During Publishing» on. I unchecked it but was still getting the error. In my case I also had «Delete all existing files prior to publish» but was not deleting everything from the target directory on the server before copying the new published files there. If you don’t do that — a «PrecompiledApp.config» file is left behind which causes the problem. Once I deleted that file I was golden on both the VS2013 and VS2015 versions of my web service.
answered Aug 6, 2015 at 20:48
JTTxJTTx
572 bronze badges
I read through every answer here looking for something that worked before I realized that I’m using IIS 10 (on Windows 10 version 2004) and this question is about IIS 7 and almost a decade old.
With that said, run this from an elevated command prompt:
dism /online /enable-feature /all /featurename:IIS-ASPNET45
The /all will automatically enable the dependent parent features: IIS-ISAPIFilter, IIS-ISAPIExtensions, and IIS-NetFxExtensibility45.
After this, you’ll notice two new (in my environment at least) application pool names mentioned .NET v4.5. ASP.NET web apps that were previously using the DefaultAppPool will just work.

answered Dec 14, 2020 at 22:14
If the top answers don’t work, look for a config named PrecompiledApp.config in the hosting directory and delete it if it exists. This file prevents IISExpress and LocalIIS to work properly. (And I think that’s a bug) The content of the file in my case was:
<precompiledApp version="2" updatable="true"/>
And I’m 100% positive that was the problem with my case since I tried everything in 2 hours and tested lots of times with this config.
One more thing: You cannot use aspnet_regiis in newer versions of Windows and IIS so try
dism /online /enable-feature /featurename:IIS-ASPNET45 /all
answered Jan 14, 2017 at 11:37
sotnsotn
4,2302 gold badges28 silver badges30 bronze badges
Control Panel > turn windows features on or off > Web Server > Application Development
Check ASP.NET
answered Feb 6, 2020 at 22:50
![]()
Please note sometimes wrong Managed pipeline mode will cause this error. There are two choices to select integrated and classic.
answered Jan 22, 2013 at 12:44
Joe.wangJoe.wang
11.3k25 gold badges102 silver badges178 bronze badges
How to Fix “HTTP Error 403.14 – Forbidden The Web server is configured to not list the contents of this directory”
This error occurs when you have MVC 2+ running hosted on IIS 7+, this is because ASP.NET 4 was not registered in IIS. In my case I was creating a MVC 3 project and hosting it on IIS 7.5.
To fix it, make sure you have MVC 2 or above and .Net Framework 4.0 installed, then run a command prompt as administrator and type the following line:
32bit (x86)
%windir%Microsoft.NETFrameworkv4.0.30319aspnet_regiis.exe -ir
64bit (x64)
%windir%Microsoft.NETFramework64v4.0.30319aspnet_regiis.exe -ir
brimble2010
17.6k7 gold badges27 silver badges44 bronze badges
answered Jan 17, 2015 at 6:16
![]()
Vishal SenVishal Sen
1,1151 gold badge13 silver badges23 bronze badges
0
Check your Global.asax file.
In my case, it was empty.
answered Dec 7, 2016 at 13:08
![]()
oyenigunoyenigun
5676 silver badges15 bronze badges
I tried everything here; nothing worked. Problem was in my Web.config file, somehow dependent assembly binding got changed from minimum 1 to minimum 0.
<!-- was -->
<runtime>
<assemblyBinding>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
<!-- should have been -->
<bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
answered Apr 6, 2017 at 8:11
codeMonkeycodeMonkey
3,8222 gold badges34 silver badges49 bronze badges
NOTHING WORKED IN THE WORLD FOR ME,
I found out the problem and this might be helpful for someone,
Applicable if you are using Plesk, I just turned this thing off and everything started to work.
Yet, I do not know what is the exact issue with it.

answered Aug 25, 2020 at 9:47
Adel MouradAdel Mourad
1,26816 silver badges12 bronze badges
1
I have also encountered this same error, despite all the provided solutions for the following reasons:
- Missing DLLs
- Database connection string points to an inaccessible server.
answered Dec 11, 2011 at 3:55
eulerfxeulerfx
36.2k5 gold badges59 silver badges82 bronze badges
In my case web.config and all files except for the /bin folder were missing (not copied somehow).
Silly, but that was the last thing I have checked.
answered Sep 3, 2012 at 16:49
eitanpoeitanpo
3441 silver badge10 bronze badges
I recently had this error and found that the problem was caused by the feature «HTTP Redirection» not being enabled on my Windows Server. This blog post helped me get through troubleshooting to find the answer (despite being older Windows Server versions): http://blogs.msdn.com/b/rjacobs/archive/2010/06/30/system-web-routing-routetable-not-working-with-iis.aspx for newer servers go to Computer management, then scroll down to the Web Server role and click add role services
answered Jan 28, 2013 at 14:00
SephSeph
8,36410 gold badges61 silver badges93 bronze badges
I’m using: Win Server 2012 R2 / IIS 8.5 / MVC4 / .Net 4.5
If none of the above worked then try this:
Uncheck «Precompile during Publishing»
This kicked my butt for a few days.
answered May 7, 2015 at 17:06
![]()
D. KermottD. Kermott
1,55315 silver badges22 bronze badges
1
With ASP.NET project with C# 4.5 I’ve solved such problem by installing ASP.NET extension in Web Platform Installer
answered Jul 9, 2015 at 13:34
Also one more things can be possible
install .net framework 4.0 manually
This solution is for IIS7 on window 7
open cmd with administration previleges
go to directory «C:WindowsMicrosoft.NETFrameworkv4.0.30319»
type aspnet_regiis.exe -i
got to your inet manager by typing in run command «inetmgr»
refresh your IIS7
reload the site.
answered Jul 19, 2016 at 8:07
I know you had this problem in an internal host, but I had experienced such an issue before in an external host and in my case it had it’s own resolution, maybe it could save somebody’s time:
In fact my website was STOPPED by some reason which currently I’m not aware of, to check it out if you have the same problem, in WebsitePanel main page go to Web -> Websites then select the domain name of your website from the list, after that in the right side of the page just opened, check if you see the word STARTED, else if you see the word STOPPED, make it get started again. That’s all.
answered Jul 22, 2017 at 12:53
![]()
Muhammad MusaviMuhammad Musavi
2,3742 gold badges21 silver badges35 bronze badges
I know this is an old topic, but you can also get this error (when you are debugging) if you have a folder named the same as a route in a controller.
For instance, if you have a UserController, with a route called /User and you ALSO have a folder in your solution called «User» then IISExpress will try to browse the folder instead of showing your view.
answered May 30, 2018 at 22:55
![]()
After trying every solution suggested here, I found yet another possible solution: URLScan
The IIS had WebDAV disabled, even in the web.config of my application, WebDAV’s handler and module was removed. PUTs still returned a 403 — Forbidden without any log entries in the IIS logs. (GET / POST worked fine).
Turns out the IIS had an active ISAPI Filter (the URLScan) enabled which prevented all PUTs. After removing URLScan, it worked for me.
answered Feb 7, 2019 at 13:53
My situation was completely different than any of these and the 403:Forbidden error message was a little bit of a red herring.
If your Application_Start() function in the Global.asax module tries to access the web.config and an entry that it’s referencing isn’t there, IIS chokes and (for some reason) throws the 403:Forbidden error message.
Double-check that you aren’t missing an entry in the web.config file that’s attempting to be accessed in your Global.asax module.
answered Sep 16, 2019 at 18:03
![]()
Jason MarsellJason Marsell
1,7222 gold badges19 silver badges10 bronze badges
In case you’re like me and have an application using NHibernate and the above answers have not resolved your issue.
You should look at the connection string in your application; possibly in the webconfig file to ensure it is correct.
answered Sep 24, 2019 at 18:33
![]()
wale Awale A
811 silver badge7 bronze badges
I have been using Identity Impersonate:
<system.web>
<identity impersonate="true" userName="domainusername" password="password"/>
</system.Web>
When pushing up to the server you have to give the username access to the Temporary ASP.NET Files folder so it can read/write/execute properly:
C:WindowsMicrosoft.NET"frameworkversion""aspversion"Temporary ASP.NET Files
Obviously replace «frameworkversion» and «aspversion» with the versions you are using.
answered May 13, 2014 at 9:40
dalemacdalemac
3551 gold badge4 silver badges15 bronze badges
Step 1: Select the Site For which the HTTP Error is produced in IIS and then click on Directory Browsing as shown in the image below:
Step 2: In the Directory Browsing Window in IIS click on Enable in Actions on the right side as shown in the diagram below:
Now Directory Browsing is enabled for your asp.net website, just restart the web application in IIS and Browse the site in your browser and see the result.
answered Jul 30, 2014 at 21:05
![]()
The problem
A rather common issue when installing an ASP.NET MVC powered by .NET Framework 4 on IIS 7.0 or higher is the sudden appearance of a HTTP Error 403 — Forbidden upon launch:
HTTP Error 403.14 — Forbidden — The Web server is configured to not list the contents of this directory.
The text might vary, but the meat is the same: despite anonymous authentication is enabled and all the permissions are set (IUSR, IIS_IUSRS, NetworkService), the web application refuses to run properly.
The fix
Well. the first thing to do obviously is to ensure that what we mentioned above is properly set: anonymous authentication must be set to enabled (Authentication icon in IIS settings) and all the aforementioned users permissions must be properly assigned (filesystem wise). If everything has been handled correctly, you can proceed to add the following section to your web application‘s web.config file:
|
<system.webServer> <modules runAllManagedModulesForAllRequests=«true»/> </system.webServer> |
Once you do that, you can try to deploy your application again: the issue should be solved.
IT Project Manager, Web Interface Architect and Lead Developer for many high-traffic web sites & services hosted in Italy and Europe. Since 2010 it’s also a lead designer for many App and games for Android, iOS and Windows Phone mobile devices for a number of italian companies. Microsoft MVP for Development Technologies since 2018.
View all posts by Ryan →
|
14 / 12 / 3 Регистрация: 20.02.2018 Сообщений: 446 |
|
|
1 |
|
|
13.08.2018, 19:22. Показов 14494. Ответов 8
Доброго времени суток! Создаю проект ASP.Net и сразу же после запуска выдаёт ошибку: HTTP Error 403.14 — Forbidden Веб-сервер настроен таким образом, чтобы не формировать списка содержимого каталога. Список действий прописанный ниже ошибки (см. на фото) выполнил — не помогло. В качестве имени сайта пробовал писать название решения и название страницы. Там ещё правда есть такое замечание: Убедитесь, что атрибут configuration/system.webServer/directoryBrowse@enabled в файле конфигурации сайта или приложения имеет значение «True» Я не нашел в файле web.config такого параметра. Подскажите, что делать? Миниатюры
__________________
0 |
|
2715 / 2026 / 374 Регистрация: 22.07.2011 Сообщений: 7,671 |
|
|
13.08.2018, 23:01 |
2 |
|
а у вас asp net то установлен , документ по умолчанию прописан в IIS , default.aspx присутствует в проекте ?
0 |
|
14 / 12 / 3 Регистрация: 20.02.2018 Сообщений: 446 |
|
|
14.08.2018, 00:00 [ТС] |
3 |
|
а у вас asp net то установлен , документ по умолчанию прописан в IIS , default.aspx присутствует в проекте ? Вот именно default.aspx нет, хотя другие страницы с подобным расширением есть и создаются. Миниатюры
0 |
|
2715 / 2026 / 374 Регистрация: 22.07.2011 Сообщений: 7,671 |
|
|
14.08.2018, 00:08 |
4 |
|
РешениеЕсли Вы в адресной строке не указываете конкретную страницу , то IIS ищет страницу по умолчанию из своих настроек , а по умолчанию там Default.aspx , так что либо настраиваете роутинг , либо создаете данную страничку . либо в адресной строке указываете конкретную страницу. Иначе будет попытка запросить содержимое веб.каталога — что запрещено по умолчанию.
2 |
|
14 / 12 / 3 Регистрация: 20.02.2018 Сообщений: 446 |
|
|
14.08.2018, 00:12 [ТС] |
5 |
|
Если Вы в адресе запроса не указываете конкретную страницу , то IIS ищет страницу по умолчанию из своих настроек , а по умолчанию там Default.aspx , так что либо настраиваете роутинг , либо создаете данную страничку . либо в адресной строке указываете конкретную страницу. Иначе будет попытка запросить содержимое веб.каталога — что запрещено по умолчанию. Т.е. страница, которая грузится 1-ой должна иметь имя «Default.aspx»? Или это отдельная страница, в которой что-то другое должно быть прописано?
0 |
|
2715 / 2026 / 374 Регистрация: 22.07.2011 Сообщений: 7,671 |
|
|
14.08.2018, 00:15 |
6 |
|
Можете грузить любую «страницу» первой , просто укажите ее полное имя. , если иных настроек у Вас нет.
1 |
|
14 / 12 / 3 Регистрация: 20.02.2018 Сообщений: 446 |
|
|
14.08.2018, 00:18 [ТС] |
7 |
|
Если в адресной строке не указана страница , то да , будет попытка найти страницу Default.aspx , и если таковой не найдется — то попытка отобразить каталог. Переименовал — запустилось. Спасибо! А можно где-то прописать в проекте чтобы он искал не Default.aspx, а другой файл (с моим именем)?
0 |
|
2715 / 2026 / 374 Регистрация: 22.07.2011 Сообщений: 7,671 |
|
|
14.08.2018, 00:20 |
8 |
|
2 |
|
14 / 12 / 3 Регистрация: 20.02.2018 Сообщений: 446 |
|
|
14.08.2018, 00:28 [ТС] |
9 |
|
sau, о спасибо!
0 |
In previous article, we have explained some error that you can find when you deployed your Asp.net core application. You can read on that link if you have same error message. In this article, we will advise other error that you can find when deploying Asp.net MVC application.
Problem
The error that you can find is HTTP Error 403.14 – Forbidden. You can see the figure below:
Solution
Some MVC sites might require to be run in Class Mode instead of integrated mode. To fix this issue:
1. You can change your application pool from Integrated to Classic Mode. You can contact our support team to change it for you.
2. If you are running asp.net 4, please add the following to your web.config file.
<handlers>
<add name="StaticFile1"
path="*.*" verb="*"
modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule"
resourceType="Either" requireAccess="Read" />
<add name="wildcard map" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:WindowsMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
</handlers>
3. If you are running asp.net 3.5, please add the following to your web.config instead:
<add name="ASP.NET-ISAPI-2.0-Wildcard"
path="*" verb="GET,HEAD,POST,DEBUG"
modules="IsapiModule"
scriptProcessor="%windir%Microsoft.NETFrameworkv2.0.50727aspnet_isapi.dll"
preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0" />
Conclusion
Hope above post help you to fix your issue! In case you’re looking for Asp.net core web hosting, please kindly visit our site at https://www.asphostportal.com.

Yury Sobolev is Full Stack Software Developer by passion and profession working on Microsoft ASP.NET Core. Also he has hands-on experience on working with Angular, Backbone, React, ASP.NET Core Web API, Restful Web Services, WCF, SQL Server.
Comments
Unauthorized access returns 403 instead 401
After the migration to .net 6, our unit tests have identified that the unauthorized access, using the AuthorizationAttribute and identity role claims, returns the http status 403 (forbidden) instead of 401 (unauthorized) as with .net 5.
It’s a breaking change, because many clients could not manage the unexpected result, and it seems undocumented.
To Reproduce
- The repro project is attached as a
.zipfile. WebApplication1.zip- Just changing the target framework, from 5 to 6 and vice versa, the http result code changes.
Further technical details
- ASP.NET Core version
@HaoK Can you please take a look at this repro?
@maurik77 can you upload your repro app to a github repo, we generally don’t open zip files
@maurik77 can you upload your repro app to a github repo, we generally don’t open zip files
Of course, but I suggest you to change the instructions that appear when you open an issue.
You can find it here: https://github.com/Maurik77/RepoBugs
Thanks for the repo, could you provide some concrete steps to demonstrate the difference 403/401 with this app on 5.0 vs 6.0
HaoK
added
the
Needs: Author Feedback
The author of this issue needs to respond in order for us to continue investigating this issue.
label
Dec 3, 2021
Hi @maurik77. We have added the «Needs: Author Feedback» label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then — please feel free to re-open it if you come back to this issue after that time.
Hi @HaoK ,
- After downloading the repo the project is set to net6.0 (RepoBugsWebApplication1.csproj)
- Run the project
- Execute: curl https://localhost:5001/weatherforecast -v
- You can verify that the app replies with http status 403 (Forbidden)
- Change the target framework to net5.0
- Run again the project
- Execute: curl https://localhost:5001/weatherforecast -v
- You can verify that the app replies with http status 401 (Unauthorized)
maurik77
changed the title
asp.net .net 6: Unauthorized access returns 403 instead 401
asp.net .net 6: Unauthorized access returns 403 instead of 401
Dec 6, 2021
Okay I see the issue, in your auth handler, you are creating an identity that is not considered authenticated since you don’t specify an authentication type, this is line: https://github.com/Maurik77/RepoBugs/blob/main/HermodrAuthenticationHandler.cs#L29
But the authorize attribute has an implicit check where we don’t consider the identity authenticated for purposes of authorization if IsAuthenticated is false
You can verify this by checking identity.IsAuthenticated, you can pass in anything like new ClaimsIdentity("foo"); which will make the behavior be a 403 as expected.
I’ll try to track down what side effects might have changed to cause this minor difference in behavior
Okay, thank you for the analysis, the problem ca be fixed, but anyway I suggest to describe the different behaviour in the
Api Diff Doc or some other official documentation because the upgrade can lead to an unexpected result.
Thanks for contacting us.
We’re moving this issue to the .NET 7 Planning milestone for future evaluation / consideration. Because it’s not immediately obvious that this is a bug in our framework, we would like to keep this around to collect more feedback, which can later help us determine the impact of it. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it’s very rare and low-impact issue, we will close it — so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.
HaoK
added
the
breaking-change
This issue / pr will introduce a breaking change, when resolved / merged.
label
Dec 9, 2021
Discussed this in triage, since the subtle change of behavior is in a scenario which isn’t really useable in practice (auth handlers really should return principals that are IsAuthenticated=true, since they won’t be useable otherwise, as that’s the flag we use to determine if the identity is considered signed in). We don’t plan on fixing this. The workaround for anyone that hits this, is to always set the authenticationType on their claims identities so IsAuthenticated will be true.
msftbot
bot
locked as resolved and limited conversation to collaborators
Jan 10, 2022

Сообщение было отмечено Volodya_ как решение