views:

27

answers:

0

I have a self hosted WCF service (using a Windows Service). The installer currently places all the exes into "program files".

I am deploying the app.config file for the windows service because it contains the service endpoint information. how can I move that file (app.config) to "program data" (%appdata%) directory and have the exe still see it?

my service OnStart looks like:

_sh = new ServiceHost(typeof(WS.Generator), new Uri(DetermineURL())); 
// start hosting
_sh.Open();

I know I could "build" the endpoint by hand but I would prefer to use the app.config file. Is there a global ConfigurationManager.YourFileIsReallyLocatedHere value? Currently the app.config file is read internally by WCF and I dont have to "build" the endpoint.

I am allowing the app.config file to change after deployment (so they can modify the settings; url, httpGetEnabled, includeExceptionDetailInFaults, httpHelpPageEnabled, etc). These values can't be modified while the app.config file is located inside the "program files" directory. thanks!