OpenExeConfiguration Path Issue
- by Harry
I'm trying to load an web.config from a server.
Its placed at: \server\folders\web.config
when i try this:
ConfigurationManager.OpenExeConfiguration(@"\\server\folders\web.config");
it searches for: web.config.config and fails.
ConfigurationManager.OpenExeConfiguration(@"\\server\folders\web");
it fails, because there is no folder \server\folders\web\
So i tried several things and it seems as its checking wether the file the path is pointing on exists, and afterwards it appliers a .config and gets the config file.
Just for fun i created an web.loaders file, and a web.loaders.config file. with
ConfigurationManager.OpenExeConfiguration(@"\\server\folders\web.local");
it loads the \server\folders\web.local.config perfectly, but throws Exceptions without the web.local file.
So there a many ways to get this small thing loaded, but isn't there a more nice one than using a temp .web file or something?
Any help i highly appreciated,
yours Harry