Is it possible using virtual directories and/or virtual applications to set up two web sites that share the same application code (aspx pages etc.) but have different web.config files? The sites and code are residing on the same server running on the same IIS.
I am using IIS 6.
The short answer is no if you want to keep the code in one place. Probably the best solution is to have the application loading a custom config file based on what you determine the site to be (presumably host header?).
Something like ConfigurationManager.OpenExeConfiguration may be useful.
I guess an alternative is to come up with a configuration convention where you have everything in the one file and use GetSection (with some kind of app specific prefix) to get the specific settings for what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With