I'm using this namespace:
using System.Configuration;
and here is my code:
private static string _smtpServer = ConfigurationManager.AppSettings["SMTPServer"];
However I am getting a compilation error saying that "ConfigurationManager" does not exist.
Thanks
Including "using" statement is not enough. In order for compiler to find your target class (ConfigurationManager), you need to REFERENCE the assembly that contains that class definition. In your case, this assembly is known as "System.Configuration".
To add a reference to the above mentioned assembly:
This should make it work. Cheers!
FavScripts.com is a free tool to save your favorite scripts and commands, then quickly find and copy-paste your commands with just few clicks.
Boost your productivity with FavScripts.com!