|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Obsolete functionHi
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'
Show quote
On May 11, 7:29 pm, "John" <J...@nospam.infovis.co.uk> wrote: They have changed (much improved) the configuration management api's> 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' 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 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 > 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 > > > > > 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 >> > >> >> >>
Show quote
On May 11, 9:40 pm, "John" <J...@nospam.infovis.co.uk> wrote: System.Configuration.dll - go and add it to your project references.> 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.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 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 [attached file: syste-configuration.jpg]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 > |
|||||||||||||||||||||||