Jump to content

method is obsolete, it has been replaced


pedro.peixoto

Recommended Posts

pedro.peixoto

Boa tarde a todos mais uma vez ;)

Se alguém me puder ajudar com este erro agradecia.

Estou a programar em C# VisualStudio 2010 e estou a guardar a minha connectionString em app.config e ao atribuir a uma string o valor guardado na config:

string StrCon = ConfigurationSettings.AppSettings["StrCon"];

estou a receber este warning:

Warning 1 'System.Configuration.ConfigurationSettings.AppSettings' is obsolete: 'This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings'

Alguém me sabe dizer como resolvo isto?

Obg

Link to post
Share on other sites
pedro.peixoto

Obrigado!!

Faltava só adicionar a Assembly.

Bastou isso para o warning desaparecer, mesmo estado com ConfigurationSettings, de qualquer forma já alterei para o ConfigurationManager.

Obrigado  ;)

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.