Can We Have Multiple Web.Config files in same project but in different folders
-
Hi, I am developing an asp.net application i require two web.config files but in different folders of same application. First Is that possible Second how if anyone knows kindly reply
It is my understanding that the web.config applies to each application. If you have a subfolder in which you want its own config then you will need to make it its own application within IIS. This usually has little impact on the application but will possibly have some deployment issues since the root of the application will be in a different memory space than the sub folder application. So your answer is no (because they will need to become seperate applications and you used that word specifically). If you can make the subfolder its own application using IIS or VS.NET then yes ;) http://www.jasncab.com/huberblog :: Jason Huber
-
It is my understanding that the web.config applies to each application. If you have a subfolder in which you want its own config then you will need to make it its own application within IIS. This usually has little impact on the application but will possibly have some deployment issues since the root of the application will be in a different memory space than the sub folder application. So your answer is no (because they will need to become seperate applications and you used that word specifically). If you can make the subfolder its own application using IIS or VS.NET then yes ;) http://www.jasncab.com/huberblog :: Jason Huber
In fact you can :) Each subfolder config files overrides it's parent's folder. Check here : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconaspnetconfiguration.asp My Blog
-
In fact you can :) Each subfolder config files overrides it's parent's folder. Check here : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconaspnetconfiguration.asp My Blog
Turns out the documentation is correct. In the past I have had trouble with this and thus I posted my solution. Although it remains true that you can just make the subfolder its own application this might lead to the subfolder not inheriting the parents web.config settings. This is something you might want. Good information!