Home All Groups Group Topic Archive Search About
Author
12 May 2007 1:29 AM
John
Hi

When using 'ConfigurationSettings.AppSettings.Get' I get the below warning.
What is the problem and how can I fix it?

Thanks

Regards

= Warning Message ============================

Warning 9 'Public Shared ReadOnly Property AppSettings() As
System.Collections.Specialized.NameValueCollection' is obsolete: 'This
method is obsolete, it has been replaced by
System.Configuration!System.Configuration.ConfigurationManager.AppSettings'

Author
12 May 2007 2:32 AM
Tom Shelton
Show quote
On May 11, 7:29 pm, "John" <J...@nospam.infovis.co.uk> wrote:
> Hi
>
> When using 'ConfigurationSettings.AppSettings.Get' I get the below warning.
> What is the problem and how can I fix it?
>
> Thanks
>
> Regards
>
> = Warning Message ============================
>
> Warning 9 'Public Shared ReadOnly Property AppSettings() As
> System.Collections.Specialized.NameValueCollection' is obsolete: 'This
> method is obsolete, it has been replaced by
> System.Configuration!System.Configuration.ConfigurationManager.AppSettings'

They have changed (much improved) the configuration management api's
in .NET 2.0.  This is telling you that you may want to switch to the
new api's.  You do this by adding a reference to
System.Configuration.dll, and then you can access your appsettings
section via ConfigurationManager.AppSettings.

Also, you may want to check out the My namespace stuff in VB2005 - it
has a lot of support for settings.

--
Tom Shelton
Author
12 May 2007 3:40 AM
John
Hi

There is no dll under System.Configuration. Also System.Configuration is
already imported. Using ConfigurationManager.AppSettings.Get(key) instead of
ConfigurationSettings.AppSettings.Get(key) gives the error
'ConfigurationManager' is not declared.

Thanks

Regards

Show quote
"Tom Shelton" <tom_shel***@comcast.net> wrote in message
news:1178937122.719070.261240@n59g2000hsh.googlegroups.com...
> On May 11, 7:29 pm, "John" <J...@nospam.infovis.co.uk> wrote:
>> Hi
>>
>> When using 'ConfigurationSettings.AppSettings.Get' I get the below
>> warning.
>> What is the problem and how can I fix it?
>>
>> Thanks
>>
>> Regards
>>
>> = Warning Message ============================
>>
>> Warning 9 'Public Shared ReadOnly Property AppSettings() As
>> System.Collections.Specialized.NameValueCollection' is obsolete: 'This
>> method is obsolete, it has been replaced by
>> System.Configuration!System.Configuration.ConfigurationManager.AppSettings'
>
> They have changed (much improved) the configuration management api's
> in .NET 2.0.  This is telling you that you may want to switch to the
> new api's.  You do this by adding a reference to
> System.Configuration.dll, and then you can access your appsettings
> section via ConfigurationManager.AppSettings.
>
> Also, you may want to check out the My namespace stuff in VB2005 - it
> has a lot of support for settings.
>
> --
> Tom Shelton
>
Author
12 May 2007 3:56 AM
EdB
John,

Try changing it to this:

System.Configuration.ConfigurationManager.AppSettings

Ed

Show quote
"John" wrote:

> Hi
>
> There is no dll under System.Configuration. Also System.Configuration is
> already imported. Using ConfigurationManager.AppSettings.Get(key) instead of
> ConfigurationSettings.AppSettings.Get(key) gives the error
> 'ConfigurationManager' is not declared.
>
> Thanks
>
> Regards
>
> "Tom Shelton" <tom_shel***@comcast.net> wrote in message
> news:1178937122.719070.261240@n59g2000hsh.googlegroups.com...
> > On May 11, 7:29 pm, "John" <J...@nospam.infovis.co.uk> wrote:
> >> Hi
> >>
> >> When using 'ConfigurationSettings.AppSettings.Get' I get the below
> >> warning.
> >> What is the problem and how can I fix it?
> >>
> >> Thanks
> >>
> >> Regards
> >>
> >> = Warning Message ============================
> >>
> >> Warning 9 'Public Shared ReadOnly Property AppSettings() As
> >> System.Collections.Specialized.NameValueCollection' is obsolete: 'This
> >> method is obsolete, it has been replaced by
> >> System.Configuration!System.Configuration.ConfigurationManager.AppSettings'
> >
> > They have changed (much improved) the configuration management api's
> > in .NET 2.0.  This is telling you that you may want to switch to the
> > new api's.  You do this by adding a reference to
> > System.Configuration.dll, and then you can access your appsettings
> > section via ConfigurationManager.AppSettings.
> >
> > Also, you may want to check out the My namespace stuff in VB2005 - it
> > has a lot of support for settings.
> >
> > --
> > Tom Shelton
> >
>
>
>
Author
12 May 2007 4:01 AM
John
Using System.Configuration.ConfigurationManager.AppSettings.Get(key) gives
the error 'ConfigurationManager' is not a member of 'Configuration'.

Many Thanks

Regards


Show quote
"EdB" <E**@discussions.microsoft.com> wrote in message
news:0C5A458B-D44B-4126-991E-6529320D30FE@microsoft.com...
> John,
>
> Try changing it to this:
>
> System.Configuration.ConfigurationManager.AppSettings
>
> Ed
>
> "John" wrote:
>
>> Hi
>>
>> There is no dll under System.Configuration. Also System.Configuration is
>> already imported. Using ConfigurationManager.AppSettings.Get(key) instead
>> of
>> ConfigurationSettings.AppSettings.Get(key) gives the error
>> 'ConfigurationManager' is not declared.
>>
>> Thanks
>>
>> Regards
>>
>> "Tom Shelton" <tom_shel***@comcast.net> wrote in message
>> news:1178937122.719070.261240@n59g2000hsh.googlegroups.com...
>> > On May 11, 7:29 pm, "John" <J...@nospam.infovis.co.uk> wrote:
>> >> Hi
>> >>
>> >> When using 'ConfigurationSettings.AppSettings.Get' I get the below
>> >> warning.
>> >> What is the problem and how can I fix it?
>> >>
>> >> Thanks
>> >>
>> >> Regards
>> >>
>> >> = Warning Message ============================
>> >>
>> >> Warning 9 'Public Shared ReadOnly Property AppSettings() As
>> >> System.Collections.Specialized.NameValueCollection' is obsolete: 'This
>> >> method is obsolete, it has been replaced by
>> >> System.Configuration!System.Configuration.ConfigurationManager.AppSettings'
>> >
>> > They have changed (much improved) the configuration management api's
>> > in .NET 2.0.  This is telling you that you may want to switch to the
>> > new api's.  You do this by adding a reference to
>> > System.Configuration.dll, and then you can access your appsettings
>> > section via ConfigurationManager.AppSettings.
>> >
>> > Also, you may want to check out the My namespace stuff in VB2005 - it
>> > has a lot of support for settings.
>> >
>> > --
>> > Tom Shelton
>> >
>>
>>
>>
Author
12 May 2007 5:12 AM
Tom Shelton
Show quote
On May 11, 9:40 pm, "John" <J...@nospam.infovis.co.uk> wrote:
> Hi
>
> There is no dll under System.Configuration. Also System.Configuration is
> already imported. Using ConfigurationManager.AppSettings.Get(key) instead of
> ConfigurationSettings.AppSettings.Get(key) gives the error
> 'ConfigurationManager' is not declared.
>
> Thanks
>
> Regards
>
> "Tom Shelton" <tom_shel***@comcast.net> wrote in message
>
> news:1178937122.719070.261240@n59g2000hsh.googlegroups.com...
>
>
>
> > On May 11, 7:29 pm, "John" <J...@nospam.infovis.co.uk> wrote:
> >> Hi
>
> >> When using 'ConfigurationSettings.AppSettings.Get' I get the below
> >> warning.
> >> What is the problem and how can I fix it?
>
> >> Thanks
>
> >> Regards
>
> >> = Warning Message ============================
>
> >> Warning 9 'Public Shared ReadOnly Property AppSettings() As
> >> System.Collections.Specialized.NameValueCollection' is obsolete: 'This
> >> method is obsolete, it has been replaced by
> >> System.Configuration!System.Configuration.ConfigurationManager.AppSettings'
>
> > They have changed (much improved) the configuration management api's
> > in .NET 2.0.  This is telling you that you may want to switch to the
> > new api's.  You do this by adding a reference to
> > System.Configuration.dll, and then you can access your appsettings
> > section via ConfigurationManager.AppSettings.
>
> > Also, you may want to check out the My namespace stuff in VB2005 - it
> > has a lot of support for settings.
>
> > --
> > Tom Shelton- Hide quoted text -
>
> - Show quoted text -

System.Configuration.dll - go and add it to your project references.
System.Configuration.ConfigurationManager lives in that dll.  VB2005 -
may very well add it automatically, because of the new my
functionality.  I can assure you that in .net 2.0 there most certainly
is a system.configuration.dll - i work in C#, and it does not import
it by default.

--
Tom Shelton
Author
13 May 2007 1:46 AM
John
Hi Tom

The System.Configuration.dll is referenced (and imported). I still can not
see a 'ConfigurationManager' under System.Configuration. Please see attached
image.

Thanks

Regards

Show quote
"Tom Shelton" <tom_shel***@comcast.net> wrote in message
news:1178937122.719070.261240@n59g2000hsh.googlegroups.com...
> On May 11, 7:29 pm, "John" <J...@nospam.infovis.co.uk> wrote:
>> Hi
>>
>> When using 'ConfigurationSettings.AppSettings.Get' I get the below
>> warning.
>> What is the problem and how can I fix it?
>>
>> Thanks
>>
>> Regards
>>
>> = Warning Message ============================
>>
>> Warning 9 'Public Shared ReadOnly Property AppSettings() As
>> System.Collections.Specialized.NameValueCollection' is obsolete: 'This
>> method is obsolete, it has been replaced by
>> System.Configuration!System.Configuration.ConfigurationManager.AppSettings'
>
> They have changed (much improved) the configuration management api's
> in .NET 2.0.  This is telling you that you may want to switch to the
> new api's.  You do this by adding a reference to
> System.Configuration.dll, and then you can access your appsettings
> section via ConfigurationManager.AppSettings.
>
> Also, you may want to check out the My namespace stuff in VB2005 - it
> has a lot of support for settings.
>
> --
> Tom Shelton
>

[attached file: syste-configuration.jpg]

AddThis Social Bookmark Button