• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 834
  • Last Modified:

ConfigurationManager doesn't exist in current context (.net v 2)

Hi there,

Can anyone help?

I keep getting an error trying to upgrade my old code using appsettings..

NameValueCollection appSettings = ConfigurationManager.AppSettings;

Error      16      The name 'ConfigurationManager' does not exist in the current context      C:\Documents and Settings\igregson\My Documents\Visual Studio 2005\Projects\GetRealTime\GetRealTime\Program.cs      54      13      GetRealTime

I can't see to resolve it.... my old code used the following but it recommends i change it..

WebAddress = ConfigurationSettings.AppSettings["WebAddress"];

Any ideas ?

Thanks in advance

Ian
0
ianinspain
Asked:
ianinspain
1 Solution
 
2266180Commented:
try to Add Reference>System.Configuration.DLL
0
 
sabeeshCommented:
Hi,
    Can you check in  web.cofig , "WebAddress" tag is present or not
0
 
2266180Commented:
that was deep :P
0
 
ianinspainAuthor Commented:
thanks ciuly! That was it...

bit new with windows forms... been using asp.net and the equivelant and you didn't need to add a reference...

I thought it was a built in reference...??

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now