locked
VB2005 ConfigurationManager not declared RRS feed

  • Question

  • In VB2005, how do I read the values in the AppSettings section of my App.Config file? In VB2003 I could use ConfigurationSettings.AppSettings, but it’s obsolete. I added Imports System.Configuration in the references tab of the  property page, but I can’t use the ConfigurationManager. It says it’s not declared.

    Friday, April 21, 2006 10:01 AM

Answers

  • ConfigurationManager is located within System.Configuration. In order to use it you’ll need to make sure in that addition to having the System.Configuration.dll referenced by the project, that you are either using its full name or have ‘Imports System.Configuration’ at the top of your code file.
    Friday, April 21, 2006 1:54 PM

All replies

  • ConfigurationManager is located within System.Configuration. In order to use it you’ll need to make sure in that addition to having the System.Configuration.dll referenced by the project, that you are either using its full name or have ‘Imports System.Configuration’ at the top of your code file.
    Friday, April 21, 2006 1:54 PM
  • This doesn't work.  I also get the message ConfigurationManager not declared
    Sunday, January 14, 2007 8:01 PM
  • Sunday, January 14, 2007 8:05 PM
  • You have to add "System.Configuration" as a reference and it will work.

    Forch

    • Proposed as answer by Corey Furman Monday, August 4, 2008 5:56 PM
    Friday, January 26, 2007 12:21 PM
  • Ding!  I forgot to add the ref.  Thanks for the quick help.
    Thanks, Corey Furman
    Monday, August 4, 2008 5:57 PM