Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting error "The name 'Configuration' does not exist in the current context"

I am using Visual Studio 2013 with .NET Framework 4.5.

I have included the System.Configuration as a reference in the project.

I have also included a using statement in the class as such:

using System.Configuration;

However, the following line still gives me the above subject error. How do I get rid of the error?

using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["WarrantySqlConnection"].ToString()))

The compile time error is on the ConfigurationManager word.

like image 544
sagesky36 Avatar asked Aug 20 '15 14:08

sagesky36


1 Answers

Try remove and re-add the reference to the assembly System.Configuration.dll , by right-clicking on the References, choose add reference and then find System.Configuration. After you add a reference to the dll if you have still problem save and close your Visual Studio and restart it.

like image 153
Salah Akbari Avatar answered Oct 17 '22 14:10

Salah Akbari