views:

27

answers:

1

I have a windows service that loads multiple "handlers" written by different developers. The windows service exe has it's own app.config which I need.

I'm trying to make it so that each developer can provide their own app.config along with their handler code. However, it seems an exe can only have one app.config. However, ASP.NET seems to support nested web.config... That's not exactly what I want, but I don't even know how I would get that to work in a windows service.

Anyone come across this before or have any ideas?

+1  A: 

I've not tried it, but I think you may be able to use the Configuration Manager to create separate Configuration objects for each of the handlers. Specifically, this page details a method for loading Configurations from "custom" filenames.

Jason Williams
ok, this seems to work. For wcf stuff settings, I have to set them manually which is OK i guess. Found a couple other ways:1) load a new appdomain for every different config I want. Or even, host a seperate exe and just do a shell call to it, but that's a little extreme...
Dave