3

I have a custom HttpModule installed on IIS 7 and is working just fine. Now I want to put settings in a configuration file where I can change them without rebuilding a new module each time.

Where should I put these settings as this module is not hosted inside any application and is server-level module. (being executed before any application).

cheers

leppie
  • 115,091
  • 17
  • 196
  • 297
Bakhshi
  • 1,299
  • 16
  • 25
  • One of possible solutions can be placing a separate config file somewhere shared (c:\sharedconfigs) and then read the config file form that hardcoded location. But I want something more standard. the web config file which is used when accessing the `ConfigurationManager` class is web.config file of current application which the request will be handled to. Maybe I can access the applicationhost.config by using `ConfigurationManager` !? – Bakhshi Feb 14 '13 at 04:24
  • 1
    It seems that for simple `appSettings` values you can use IIS Manager UI and add values to configuration file of root node. then you can access you values just as normal settings using `ConfigurationManager.AppSettings`. I still have no idea about custom sections in configuration files. And this configuration file, on my x64 computer with .NET 2, is located in `C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG\web.config` – Bakhshi Feb 14 '13 at 05:08

1 Answers1

2

OK,

Here is the result of googling and more research on this issue:

  1. There is another question about adding custom section in iis
  2. Which itself links to another article

So, it seems that it is possible to do such thing as storing shared configuration among sites (to be consumed by IIS7 server level module) in custom configuration section.

Community
  • 1
  • 1
Bakhshi
  • 1,299
  • 16
  • 25