missing ConfigurationManager

Last post 06-11-2007 2:20 PM by misuk11. 2 replies.

Sort Posts:

  • missing ConfigurationManager

    06-11-2007, 7:10 AM
    • Loading...
    • misuk11
    • Joined on 08-05-2003, 2:40 AM
    • Posts 473

    i want to read out a particular setting from the we.config file but am getting an error on this line

    string  s = System.Configuration.ConfigurationManager.AppSettings["setting"]

     

    i get a compilation error

     The type or namespace name 'ConfigurationManager' does not exist in the namespace System.Configuration

    I am using System.Configuration at the top of my codebehind file (I also use this in another class and that compiles with no problems)

    Any idea what could be going on here ? 

     

     

  • Re: missing ConfigurationManager

    06-11-2007, 10:18 AM
    Answer
    • Loading...
    • deblendewim
    • Joined on 12-20-2006, 4:32 PM
    • Antwerp, Belgium
    • Posts 948

    Hi,

    I followed the instructions here: (http://aspnet.4guysfromrolla.com/articles/053102-1.aspx) and all works fine.

    Normally you don't even need to add the Using System.Configuration on top of the page.

    Maybe these brackets: [] are wrong; maybe they should be round.

    Is the appSettings tag in the web.config in the right place? (like here below; between the end-configSections and the start-system.web)

     

    	</configSections>
    	<appSettings>
    		<add key="setting" value="TEST VALUE" />
    	</appSettings>
    	<system.web>
     Please refer to the article!

    Hope this helps.
    Wim
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
  • Re: missing ConfigurationManager

    06-11-2007, 2:20 PM
    • Loading...
    • misuk11
    • Joined on 08-05-2003, 2:40 AM
    • Posts 473

     

    I managed to solve it in the end, I neded to add a reference to the System.Configuration assembly  (Not Using System.Configuration as I'd already done that)

     

Page 1 of 1 (3 items)
Microsoft Communities
Page view counter