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
ianinspainAsked:
Who is Participating?
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.