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. Web Development
  3. ASP.NET
  4. complex appSettings entries

complex appSettings entries

Scheduled Pinned Locked Moved ASP.NET
question
7 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.
  • B Offline
    B Offline
    boy pockets
    wrote on last edited by
    #1

    In the appSettings section of the Web.config I want to store 'complex' types such as Collections. Currently to achieve this I am using class libries with a Settings.settings file which allows this (with a nice interface). But I want to move the data to the Web.config file as this will allow me to change the values at runtime (essential). Does anyone have any ideas on how I can do this? At present, I am simply delimiting the entries with a special character. I fear this may be the best solution... cheers.

    V B 3 Replies Last reply
    0
    • B boy pockets

      In the appSettings section of the Web.config I want to store 'complex' types such as Collections. Currently to achieve this I am using class libries with a Settings.settings file which allows this (with a nice interface). But I want to move the data to the Web.config file as this will allow me to change the values at runtime (essential). Does anyone have any ideas on how I can do this? At present, I am simply delimiting the entries with a special character. I fear this may be the best solution... cheers.

      V Offline
      V Offline
      Venkatesh Mookkan
      wrote on last edited by
      #2

      Web.config is a Configuration file which help in setting up of a website. Change the Web.config at runtime will restart the application (i.e) all the session information will lose. You have to start the application again.

      Castle Rider

      What if I freeze??? Don't forget to breath...

      My: Website | Yahoo Group | Blog Spot

      B 1 Reply Last reply
      0
      • B boy pockets

        In the appSettings section of the Web.config I want to store 'complex' types such as Collections. Currently to achieve this I am using class libries with a Settings.settings file which allows this (with a nice interface). But I want to move the data to the Web.config file as this will allow me to change the values at runtime (essential). Does anyone have any ideas on how I can do this? At present, I am simply delimiting the entries with a special character. I fear this may be the best solution... cheers.

        V Offline
        V Offline
        Venkatesh Mookkan
        wrote on last edited by
        #3

        Web.config is a Configuration file which help in setting up of a website. Change the Web.config at runtime will restart the application (i.e) all the session information will lose. You have to start the application again. The storing your 'Complex' collections in Web.config which is changing at runtime is a bad idea. Try to use XML files.

        Castle Rider

        What if I freeze??? Don't forget to breath...

        My: Website | Yahoo Group | Blog Spot

        B 1 Reply Last reply
        0
        • V Venkatesh Mookkan

          Web.config is a Configuration file which help in setting up of a website. Change the Web.config at runtime will restart the application (i.e) all the session information will lose. You have to start the application again.

          Castle Rider

          What if I freeze??? Don't forget to breath...

          My: Website | Yahoo Group | Blog Spot

          B Offline
          B Offline
          boy pockets
          wrote on last edited by
          #4

          I understand the Web.config But if I change a variable in the appSettings section on the server, then it will update live and users sessions are not lost - they get the new value and their session is maintained. But my question is about storing 'complex' types.

          V 1 Reply Last reply
          0
          • B boy pockets

            I understand the Web.config But if I change a variable in the appSettings section on the server, then it will update live and users sessions are not lost - they get the new value and their session is maintained. But my question is about storing 'complex' types.

            V Offline
            V Offline
            Venkatesh Mookkan
            wrote on last edited by
            #5

            boy.pockets wrote:

            But if I change a variable in the appSettings section on the server, then it will update live and users sessions are not lost - they get the new value and their session is maintained.

            I believe, that not going to happen.

            boy.pockets wrote:

            But my question is about storing 'complex' types.

            All serializable collections can be stored in XML files.

            Castle Rider

            What if I freeze??? Don't forget to breath...

            My: Website | Yahoo Group | Blog Spot

            1 Reply Last reply
            0
            • V Venkatesh Mookkan

              Web.config is a Configuration file which help in setting up of a website. Change the Web.config at runtime will restart the application (i.e) all the session information will lose. You have to start the application again. The storing your 'Complex' collections in Web.config which is changing at runtime is a bad idea. Try to use XML files.

              Castle Rider

              What if I freeze??? Don't forget to breath...

              My: Website | Yahoo Group | Blog Spot

              B Offline
              B Offline
              boy pockets
              wrote on last edited by
              #6

              Thanks for taking the time to answer again. I hear what you are saying about xml files and will look into it (i know you can specify an 'external' file to extend the appSettings section). my experience is at odds with what you are saying about changing Web.config appSettings entries at runtime and loosing session information. Because I believe I am already doing it (I might be mistaken). Perhaps you could point me to some articles/doco backing up your point of view?

              1 Reply Last reply
              0
              • B boy pockets

                In the appSettings section of the Web.config I want to store 'complex' types such as Collections. Currently to achieve this I am using class libries with a Settings.settings file which allows this (with a nice interface). But I want to move the data to the Web.config file as this will allow me to change the values at runtime (essential). Does anyone have any ideas on how I can do this? At present, I am simply delimiting the entries with a special character. I fear this may be the best solution... cheers.

                B Offline
                B Offline
                boy pockets
                wrote on last edited by
                #7

                Here is the answer i was looking for: mysteries of configuration anyone making a medium-large scale web site should know about this :)

                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