Is there a way to tell IIS to read configurations from a different file than web.config?

Why would anyone do this?

Convenience. When working with static resources like an .aspx, or .js, or an MVC view file, it is often sufficient to hit Refresh in the browser to see the effect of that change.

Also, more specific to our scenario is that we re-use some of our code-base in different flavors of the web site, their differences being defined in their respective .config files, and each of these sites run locally on our development clients.

Getting the change to a different location than the one you are actually working in is somewhat time-consuming: A Publish operation will properly compile and copy the entire web application to the target location, copying the individually changed file manually is often... fiddly.

So what I would like for to be possible is this:

I work on my project in c:\workbench\FlavMaster3000. In this folder I create the various flavors of web.config files:

  • web.banana.config
  • web.cherry.config

I create sites in IIS that represents each flavour and set their directory to the same as above.

And I would like for IIS to read each site's configurations from the respective flavor of .config.

Is this at all possible, or am I a dreamer with a hopeless dream?


Related posts

Recent Viewed