Am I approaching this right?

Hey all, first time in the sub.

I’m making a Windows Service in C# and I need to configure some parameters on it. Mainly it’s connection strings for different databases but also some behavioral settings (update frequency, etc.).

I’m having some trouble sharing the application settings using the “Settings.settings” between the two projects in my solution: the windows service & the form app to configure it. I can make the form save/load the settings from the “user.config” file in AppData, but I’ve been trying to load this file into the service but haven’t been successful. Is this even possible? Should I just approach it through custom XML files that I deserialize on runtime when starting the service? Maybe as launch parameters when starting the service? This includes passwords, which I’m still thinking on how to save securely.

I have the service running doing what I need, I just need to be able to configure those parameters so it’s not all hardcoded.

Any help’s appreciated 🙂

submitted by /u/DukeNukem141
[link] [comments]

Leave a Reply