Saving/Loading settings from Windows Service
-
I'm new to writing services and I'm having some trouble figuring out a way to write configuration settings so the service would be able to read it. I decided to write a separate configuration application with its own namespace. I tried loading the setting by declaring and assigning a new instance of the settings from the other project. Problem is... it doesn't load from the other project, it loads a new instance of those settings for the current project (which makes sense, really -wouldn't want other applications accessing my settings). My question is, how should I get past this security feature. Is there something built into the
ApplicationSettingsBase
type that I'm not aware of? Should I save to and load from a static config file? Should I use an INI instead? Any thoughts would be appreciated. -
I'm new to writing services and I'm having some trouble figuring out a way to write configuration settings so the service would be able to read it. I decided to write a separate configuration application with its own namespace. I tried loading the setting by declaring and assigning a new instance of the settings from the other project. Problem is... it doesn't load from the other project, it loads a new instance of those settings for the current project (which makes sense, really -wouldn't want other applications accessing my settings). My question is, how should I get past this security feature. Is there something built into the
ApplicationSettingsBase
type that I'm not aware of? Should I save to and load from a static config file? Should I use an INI instead? Any thoughts would be appreciated.I decided to serialize the object i was using to keep my configuration settings and save it to a static xml file. This seems like the simplest method to me. To reiterate my original question: Does anyone have any tips on the best practice for setting up a configuration tool for another application? I did some digging and can't quite find anything. Although... an idea just struck me. What if I call the config tool from the same executable that the service is run through? I'll have to try this out later since I've already got this working.