Wednesday, May 8, 2013

Accessing remote application settings

I have a C# Windows service app that has application settings and db connection strings that I've defined in myservice.exe.config. I want to access those settings from another application so that the user can modify those settings through a nice UI. I'm using:


ConfigurationManager.OpenExeConfiguration(installPath\myservice.exe) to access the config file. It works just fine for the connection strings. However, the AppSettings property on that object is empty--no settings found. I'm not sure what I'm doing wrong here. The config file has both per-application and per-user settings in it. What I really want to access are the per-user settings (or at least one of them). Am I better off just manipulating this config file using XML directly?


Thanks!




Darren




Darren Mar-Elia MS-MVP, Group Policy

www.gpoguy.com

www.sdmsoftware.com - "The Group Policy Experts"


No comments:

Post a Comment