Alex Rivera | Logout

A default document is not configured for the requested URL, and directory browsing is not enabled on the server

Asked 2011-01-11T05:36:23.937
61

I have just deployed my ASP.NET MVC 2 website to a server (using dotnetpanel). But I'm getting this error:

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

What settings do I need? It's a dotnetpanel-based hosting server.

Edit
Report

2 Answers

42

Which version of IIS is your host running? One thing to try is to put a dummy default.aspx file in the root folder (this will not be used when MVC is working, but can get rid of this problem).

answered 2011-01-11T07:27:28.673
21

Following applies to IIS 7

The error is trying to tell you that one of two things is not working properly:

  • There is no default page (e.g., index.html, default.aspx) for your site. This could mean that the Default Document "feature" is entirely disabled, or just misconfigured.
  • Directory browsing isn't enabled. That is, if you're not serving a default page for your site, maybe you intend to let users navigate the directory contents of your site via http (like a remote "windows explorer").

See the following link for instructions on how to diagnose and fix the above issues.

http://support.microsoft.com/kb/942062/en-us

If neither of these issues is the problem, another thing to check is to make sure that the application pool configured for your website (under IIS Manager, select your website, and click "Basic Settings" on the far right) is configured with the same .Net framework version (in IIS Manager, under "Application Pools") as the targetFramework configured in your web.config, e.g.:

<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
    <httpRuntime targetFramework="4.0" />
  </system.web>

I'm not sure why this would generate such a seemingly unrelated error message, but it did for me.

answered 2013-04-04T01:16:59.827

Your Answer