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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Saving\Reading Configuration parameters in a WebService.

Saving\Reading Configuration parameters in a WebService.

Scheduled Pinned Locked Moved ASP.NET
questionworkspace
2 Posts 2 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.
  • G Offline
    G Offline
    Gilad Kapelushnik
    wrote on last edited by
    #1

    Hello. I'm writting a web service which is constructed of some DLLs. Each dll has its configuration properties. I would like to be able to save & read these configuration paramaters in files (a file for each DLL) during runtime. I found endless classes from Framework 2.0 that claim to do this but haven't found nothing that saves the configuration to a simple file and reads it back in a simple manner. In the Configuration namespace I found a way to save paramaters. I constructed a ConfigurationSection and was able to save it into a file but found no way to read it (very strange to find a SaveAs mathod without a Read method). Just saving it would create a XXX.exe.config which isn't going to work for the webservice. Any ideas ? Gilad.

    M 1 Reply Last reply
    0
    • G Gilad Kapelushnik

      Hello. I'm writting a web service which is constructed of some DLLs. Each dll has its configuration properties. I would like to be able to save & read these configuration paramaters in files (a file for each DLL) during runtime. I found endless classes from Framework 2.0 that claim to do this but haven't found nothing that saves the configuration to a simple file and reads it back in a simple manner. In the Configuration namespace I found a way to save paramaters. I constructed a ConfigurationSection and was able to save it into a file but found no way to read it (very strange to find a SaveAs mathod without a Read method). Just saving it would create a XXX.exe.config which isn't going to work for the webservice. Any ideas ? Gilad.

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Hi there, Here are a couple of tips which are already documented in MSDN: + You can use the methods of the ConfigurationManager or WebConfigurationManager to open the config file, and these methods basically return the Configuration object. + The Configuration object provides you with the GetSection, GetSectionGroup to read the configuration settings, and the Save, SaveAs methods to save the settings.

      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