Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Saving/Loading settings from Windows Service

Saving/Loading settings from Windows Service

Scheduled Pinned Locked Moved C#
questionsecurityhelpdiscussionworkspace
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jchalfant
    wrote on last edited by
    #1

    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.

    J 1 Reply Last reply
    0
    • J jchalfant

      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.

      J Offline
      J Offline
      jchalfant
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups