Right now, we have a setup something like this for our business:
- App pool 1 - Site 1 - App pool 2 - Site 2 - App pool 3 - Site 3
There correspond to:
C:\inetpub\Site C:\inetpub\Site2 C:\inetpub\Site3strings) C:\inetpub\Site4
And so on. This is annoying, as our code needs to be maintained across multiple folders, and people often forget to do so; that's an issue that can be fixed, but I'd rather solve it in the solution rather than the process. The code in all the folders is identical, only the web.config files are different.
The reason we have our sites split this way despite the identical .NET code is that we need different connection strings to different servers. This way, whichever site hosts the binding gets the traffic. This is how we handle load balancing, which is not the prettiest way, but it gets the job done.
I'd rather MULTIPLE sites (with one or multiple app pools, doesn't matter) which work the same way, but function with ONE shared code folder. What I need is a solution to handle the connection strings based on the site in IIS. I didn't have much luck looking into virtual directories, which seemed straightforward but I don't think is possible, as it needs a web.config to even know WHERE to look for virtual directories.
I'm sure I'm missing something simple here, but I need a little help to get to this:
C:\inetpub\SiteMaster (contains all .NET code) C:\inetpub\SiteMaster\Site1_Config (only needs to tell me the connection strings) C:\inetpub\SiteMaster\Site2_Config (only needs to tell me the connection strings) C:\inetpub\SiteMaster\Site3_Config (only needs to tell me the connection strings)