I got the following warning
'System.Configuration.ConfigurationSettings.AppSettings' is obsolete: '"This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings"'
How do you fix it?
It appears there is a way to do this in . NET 3.5 by setting the allowOverride attribute in the appSettings definition section of machine. config. This allows you to override the entire section in your own app.
ConfigurationManager was added to support ASP.NET Core's new WebApplication model, used for simplifying the ASP.NET Core startup code.
Gets the AppSettingsSection data for the current application's default configuration.
It is important to realize that the entire <appSettings> section is read, parsed, and cached the first time we retrieve a setting value.
Add a reference to the assembly System.Configuration
.
Then at the top (assuming C#) using System.Configuration (Imports System.Configuration in VB.NET).
Use ConfigurationManager.AppSettings["MySetting"]
to access the settings!
as its a warning i dont think it matters unless you have turned off a treat warnings as errors setting
add a reference to System.Configuration
all you have to do is to update to the latest code so where you used ConfigurationSettings.AppSettings[""] change to ConfigurationManager.AppSettings[""]
and this should work
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With