Error 1 The name 'ConfigurationManager' does not exist in the current context C:\Users\ASIF ALI\documents\visual studio 2013\Projects\helloAppAgain\helloAppAgain\Form1.cs 25 26 helloAppAgain code example

Example: configurationmanager does not exist in the current context

It's not only necessary to use the namespace System.Configuration. You have also to add the reference to the assembly System.Configuration.dll , by

Right-click on the References / Dependencies
Choose Add Reference
Find and add System.Configuration. In Assembly
This will work for sure. Also for the NameValueCollection you have to write:

using System.Configuration;

var efConnectionString = ConfigurationManager.ConnectionStrings["MyWebConfigEfConnection"].ConnectionString;

Tags:

Misc Example