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. ConfigurationSettings

ConfigurationSettings

Scheduled Pinned Locked Moved C#
sysadminsecurityquestion
4 Posts 3 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.
  • S Offline
    S Offline
    Steve Severance
    wrote on last edited by
    #1

    I am trying to read a custom config section but its not working. ConfigurationSetting.GetConfig() returns null; CONFIG FILE:

    CODE: IDictionary valueTable = (IDictionary)ConfigurationSettings.GetConfig("data"); string Server = (string)valueTable["Server"]; string Username = (string)valueTable["Username"]; string Password = (string)valueTable["Password"]; string Encrypt = (string)valueTable["Encrypt"]; string Security = (string)valueTable["Security"]; Any ideas? Thanks. Steve Not all who wander are lost...

    J 1 Reply Last reply
    0
    • S Steve Severance

      I am trying to read a custom config section but its not working. ConfigurationSetting.GetConfig() returns null; CONFIG FILE:

      CODE: IDictionary valueTable = (IDictionary)ConfigurationSettings.GetConfig("data"); string Server = (string)valueTable["Server"]; string Username = (string)valueTable["Username"]; string Password = (string)valueTable["Password"]; string Encrypt = (string)valueTable["Encrypt"]; string Security = (string)valueTable["Security"]; Any ideas? Thanks. Steve Not all who wander are lost...

      J Offline
      J Offline
      James T Johnson
      wrote on last edited by
      #2

      You need to change the section line to specify the full assembly name (since the assembly has a strong name this means the typename, the assembly name, version, and public key token). <section name="data" type="System.Configuration.SingleTagSectionHandler, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> I have an article that's done but needs formatting and proofreading before I post it. James "Java is free - and worth every penny." - Christian Graus

      J 1 Reply Last reply
      0
      • J James T Johnson

        You need to change the section line to specify the full assembly name (since the assembly has a strong name this means the typename, the assembly name, version, and public key token). <section name="data" type="System.Configuration.SingleTagSectionHandler, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> I have an article that's done but needs formatting and proofreading before I post it. James "Java is free - and worth every penny." - Christian Graus

        J Offline
        J Offline
        jparsons
        wrote on last edited by
        #3

        I'm getting a 404 on your article. Jared jparsons@jparsons.org www.prism.gatech.edu/~gte477n

        J 1 Reply Last reply
        0
        • J jparsons

          I'm getting a 404 on your article. Jared jparsons@jparsons.org www.prism.gatech.edu/~gte477n

          J Offline
          J Offline
          James T Johnson
          wrote on last edited by
          #4

          Oops :-O it should have been configurationhandler not section :) Correct link[^] James "Java is free - and worth every penny." - Christian Graus

          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