Asp Default document not working with IIS7

I have a classic asp application in a .NET 4.0 application. I set the default document to login.asp, but it does not automatically redirect to it. The whole application works fine and even displays login.asp correctly if I view it.

The default section of the document in the web.config file is as follows:

<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 looked at other similar issues on this site, but didn't really help.

+4
source share
3 answers

Finally, I found that the problem was that the asp application was assigned to the application pool in classic mode using the .NET Framework 4.0.

As soon as I changed the application pool to use the .NET Framework 2.0 (with a managed pipeline in classic mode), the default document started working too!

+7
source
  • Make sure you have Read / Write. The delegation function for the document is enabled by default: 1.jpg

  • DefaultDocument does not redirect the file (i.e. the URL does not change). It acts like the Server.Transfer function - executes the file when the root URL is requested ( http: // sitename / ). Your login.asp may be complete, but it has instructions for redirecting registered users to another page or displaying different content for them.

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

+5
source

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

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

It turns out my problem was that the File> New Project wizard uses .NET 4.5.2 by default, and this is not yet fully supported by Azure. I recompiled using .NET 4.5 as the target, and now everything works!

+1
source

All Articles