Showing posts with label IIS 7. Show all posts
Showing posts with label IIS 7. Show all posts

Monday, March 31, 2014

Error 403, 403.14, 404 - After deploying ASP.NET MVC website on IIS 7, IIS 7.5

After deploying your ASP.NET MVC website on IIS 7 or IIS 7.5, you might face following errors while browsing your website:

  • 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)

Following are the possible causes/ fixes for this -
  • Make sure the Application pool targets correct version of .NET framework (i.e .NET Framework v4.0.30319 for .NET 4 and 4.5)
  • 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 403.14, or 404 error, above are the possible causes and fixes.