My ASP.NET Site Seems to be Using the Wrong Web.config File

My ASP.NET Site Seems to Be Using the Wrong Web.config File

Issue
When you put an ASP.NET application into a virtual directory, it appears to be using the web.config file from the root.

Cause
This is by design with ASP.NET .  This is not a bug.

Resolution
By design, ASP.NET web.config files "inherit" from each other.  If you have a web.config in the root and a web.config in a vitual directory, the web.config in the virtual directory inherits from the web.config in the root. As a work around, you will need to create a subdomain to deploy your code into.  When using a subdomain, web.config files do not inherit from each other.
If you would like to create a new subdomain for your ASP.NET application you may follow the steps in How to Create a Subdomain.

Add Feedback