Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

'ConfigurationManager' is not a member of 'Configuration'.

Posted on 2008-06-11
4
Medium Priority
?
4,453 Views
Last Modified: 2012-06-27
I am working in Visual Studio 2005 and have 2 web apps.  Both of them have this in the VB Code Behind:
        Dim connectionString As String = ConfigurationSettings.AppSettings("theConnectionString").Replace("ClientName", Session("Client"))

ConfigurationSettings.AppSettings keeps getting a warning, so taking the warning suggestion I recoded it as:
        Dim connectionString As String = System.Configuration.ConfigurationManager.AppSettings("theConnectionString").Replace("ClientName", Session("Client"))

In the first app, it works without an error.

But in the second app, I get this error:
'ConfigurationManager' is not a member of 'Configuration'.

I cannot figure out what is basically different between the two apps.  Why is this happening?
0
Comment
Question by:wsturdev
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 25

Accepted Solution

by:
apeter earned 2000 total points
ID: 21762439
You have to add referece to the assembly "System.configuration"  to your project to enable ConfigurationManager.
0
 
LVL 1

Author Closing Comment

by:wsturdev
ID: 31466248
At first I didn't knwo what you meant, because I am dense...  but then got it.  Thanks!!
0
 
LVL 1

Expert Comment

by:thefarm
ID: 22317781
I have multiple projects in a solution. I had to right click on each project and add a reference to System.Configuration to each. Then I had to specify System.Configuraiton.ConfigurationManager.AppSettings("var")
Configuraiton.ConfigurationManager.AppSettings("var") alone did not work at removing the error.
I did not need the Imports System Configuration statement on the individual vb pages after doing this.
0
 
LVL 25

Expert Comment

by:apeter
ID: 22324798
You have to add "Imports" as well in each page.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question