8

I have a classic asp application inside a .NET 4.0 application. I have set the default document to login.asp, but it does not automatically redirect to it. The entire application functions fine though and even displays the login.asp correctly if I browse to it.

The default document section in web.config is as below:

<defaultDocument>
    <files>
        <clear />
        <add value="login.asp" />
        <add value="index.html" />
        <add value="default.aspx" />
        <add value="Default.htm" />
        <add value="Default.asp" />
        <add value="index.htm" />
        <add value="iisstart.htm" />
    </files>
</defaultDocument>

I have looked at other similar questions on this site but were not of much help.

KyleMit
  • 30,350
  • 66
  • 462
  • 664
Shirlz
  • 837
  • 2
  • 11
  • 18

3 Answers3

13

I finally found the issue was because the asp application was assigned to an app pool in classic mode using .NET Framework 4.0.

Once I changed the app pool to use .NET Framework 2.0 (with managed pipeline in classic mode), the default document started to work too!

Shirlz
  • 837
  • 2
  • 11
  • 18
  • 1
    Are you sure the new app pool is in Classic mode? I forgot that `system.webServer` section only works in Integrated mode. – Artem Koshelev Oct 04 '11 at 09:28
  • Yes, I had to make it classic mode to get the asp application to work. – Shirlz Oct 04 '11 at 22:54
  • You saved my week! Nothing about the site was changed, but a Windows update must have made something as the site would start with my custom `DefaultPage`. I didn't change the pipeline mode, but setting the .NET version to 2.0.x made the site load again. – Gustav Oct 03 '15 at 16:01
5
  1. Make sure you have Read/Write Feature Delegation enabled for Default Document: 1.jpg

  2. DefaultDocument does not redirect to the file (i.e. URL is not changed). It acts similar to Server.Transfer function — executes the file when root URL (http://sitename/) is requested. Probably, your login.asp executed but it has instructions to redirect logged-in users to a different page, or display the different content to them.

  3. Make sure the response is not cached. Clear cache and cookies and try again.

Artem Koshelev
  • 10,548
  • 4
  • 36
  • 68
  • Thank you for your very clear instructions. I finally found the issue was because the asp application was assigned to an app pool in classic mode using .net framework 4.0. Once I changed this to use .net 2.0, the default document started to work too! – Shirlz Oct 04 '11 at 06:45
4

I had this problem today with a brand new asp.net site deployed to Azure. I tried messing with IIS and my web.config included

<defaultDocument enabled="true">
    <files>
        <clear />
        <add value="Index.html" />
    </files>
</defaultDocument>

Turns out my problem was that the File > New Project wizard uses .NET 4.5.2 by default, and that isn't fully supported yet in Azure. I recompiled using .NET 4.5 as the target and everything works now!

David Frodin
  • 100
  • 5