Link to home
Start Free TrialLog in
Avatar of NigelRocks
NigelRocks

asked on

Missing Configuration Manager

Experts,

I have a web app in C# that has always worked, but now when I run it I get an error on this line:

          using (SqlConnection gdbConnection = new SqlConnection(ConfigurationManager.ConnectionStrings[connectionStringName].ConnectionString))

It says that the "ConfigurationMangager" object doesn't exist.  I thought that class was part of the framework, but it's acting like I need to instantiate it myself.  What am I missing?
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

You need to add a reference to the System.Configuration.dll to your project.
Avatar of NigelRocks
NigelRocks

ASKER

Oh, sorry I forgot to mention I did that.  What's strange is that I don't see it listed anywhere in the solution explorer.  In fact, I don't see the "refrerences" folder anywhere, so after I right-click on the project and add the reference, I can't tell if it's been added or not.  Guess not.
I am going to assume that ConfigurationMangager is a typo, right?  Is this a web site or a web application (.csproj file)?
Yes, that's a typo.  It's a web site.
ASKER CERTIFIED SOLUTION
Avatar of varungd
varungd

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ConfigurationManager is the 2.0 and 3.5 way, and that is the 1.1 way, so let's not go there, OK?
What happens with a new temporary test web site?