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. multiple configuration files

multiple configuration files

Scheduled Pinned Locked Moved ASP.NET
tutorialquestionworkspace
5 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.
  • C Offline
    C Offline
    chakkara2003
    wrote on last edited by
    #1

    hi all how can i use multiple configuration file that is one web config file and some other files with .config extention and also how to refer the keys thanx in advance coolsweety

    M 2 Replies Last reply
    0
    • C chakkara2003

      hi all how can i use multiple configuration file that is one web config file and some other files with .config extention and also how to refer the keys thanx in advance coolsweety

      M Offline
      M Offline
      Mike Ellison
      wrote on last edited by
      #2

      Does this article help? http://www.codeproject.com/dotnet/appsettings_fileattribute.asp[^]

      1 Reply Last reply
      0
      • C chakkara2003

        hi all how can i use multiple configuration file that is one web config file and some other files with .config extention and also how to refer the keys thanx in advance coolsweety

        M Offline
        M Offline
        Mike Ellison
        wrote on last edited by
        #3

        I also think the new ASP.NET 2.0 attribute configSource may be useful to you - look at the MSDN documentation: General Attributes Inherited by Section Elements[^] and see if it helps.

        C 2 Replies Last reply
        0
        • M Mike Ellison

          I also think the new ASP.NET 2.0 attribute configSource may be useful to you - look at the MSDN documentation: General Attributes Inherited by Section Elements[^] and see if it helps.

          C Offline
          C Offline
          chakkara2003
          wrote on last edited by
          #4

          hello sir, thanx, i used the same code from code project. if i gave the file name directly, then am getting one exception. and if i gave file name in with relative path it wont give any exception but didnt get any value. the code is shown below. settings.config appSettings add key="Setting1" value="This is Setting 1 from ettings.config" add key="Setting2" value="This is Setting 2 from settings.config" add key="ConnectionString" value="ConnectString from settings.confg" appSettings and web.config is appSettings file="//Settings.config" appSettings and in cs file string ConfigAttributeValue = ConfigurationManager.AppSettings["ConnectionString"]; Response.Write(ConfigAttributeValue); exception i ma getting is The root element must match the name of the section referencing the file, 'appSettings' (c:\inetpub\wwwroot\referexternalfiles\secondtestfileext\Settings.config am using framework2 and vs2005 can u help me to get rid off this problem coolsweety -- modified at 0:37 Tuesday 25th April, 2006

          1 Reply Last reply
          0
          • M Mike Ellison

            I also think the new ASP.NET 2.0 attribute configSource may be useful to you - look at the MSDN documentation: General Attributes Inherited by Section Elements[^] and see if it helps.

            C Offline
            C Offline
            chakkara2003
            wrote on last edited by
            #5

            thanx all, it is working. the mistake wat i made is i had created the second config file with all attributes in configurationsettings, no need of using all setting use only appsettings in second config file coolsweety

            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