September 17, 2014 08:59 by
Peter
I have build a ASP.NET 4.5 and ASP.NET MVC 6 web app which works fine locally (IIS Express & dev server) but once I deploy it to my web server, sometimes it throws Error:
- 403.14 - Forbidden (The Web server is configured to not list the contents of this directory.)
- 404 - Not Found (The resource you are looking for has been removed, had its name changed, or is temporarily unavailable)
SOLUTION
- Make sure the Application pool targets correct version of .NET framework (i.e .NET Framework v4.0.30319 for .NET 4.5 and 4.5.2)
- Make sure You have setup the website as an application in IIS
- Make sure the Pipeline mode of IIS Application pool is "Integrated"
- Check UrlRoutingModule-4.0 is added in the modules of that website.
- (To do that, open list of added modules by clicking "Modules" against your website, and see if the module "UrlRoutingModule-4.0" is added or not). If not, then add a module by clicking "Add Managed Module" button, where select System.Web.Routing.UrlRoutingModule as a Module type, and give "UrlRoutingModule-4.0" as its name)
- Make sure you have following element added in system.webServer section of website's web.config
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"></modules>
</system.webServer>
In most cases of HTTP Error 403.14, or 404, above are the possible causes and fixes.