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(Configuratio nManager.C onnectionS trings[con nectionStr ingName].C onnectionS tring))
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?
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(Configuratio
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?
You need to add a reference to the System.Configuration.dll to your project.
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)?
ASKER
Yes, that's a typo. It's a web site.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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?