Tuesday, February 21, 2012

Using System.Configuration


If I am looking to get connection string from my app.config I may write as followis:

using System.Configuration;

...
Trying to access ConfigurationManager would not be successful if you do not add a reference to System.Configuration.dll. Visual Studio would not complain that you miss System.Configuration.dll. This is very strange. VS 2010 do not show any indication of missing System.Configuration.dll.
So if you have the following
using using System.Configuration;

But can not access any methods from this, you miss a reference to this DLL. Visual Studio will not notice you if you have default configuration.

No comments:

Post a Comment