Tuesday, September 9, 2008

Resolve ConfigurationSettings.AppSetting is absolete warning

While migrating any .Net application from .Net 2003 to .Net 2005 and above we usally get this warning

This warning exists because this method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings

Steps to resolve this issue
1. Add a project reference to System.Configuration.dll.
2. Replace all ConfigurationSettings.AppSettings with ConfigurationManager.AppSettings.

Further if u still get Configuration file app.config or web.config cannot be read

Follow this steps
1. Click on App.config
2. Change build action propert to "Embedded Resource" to "None"

No comments: