Configurationmanager Does Not Exist Current Context Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us
The Name Configurationmanager Does Not Exist In The Current Context
Learn more about Stack Overflow the company Business Learn more about hiring developers the name configurationmanager does not exist in the current context c# or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow configuration manager does not exist in the current context Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How to avoid “The name 'ConfigurationManager' does not
Configurationmanager C#
exist in the current context” error? up vote 2 down vote favorite I am using VS2008. I have a project connect with a database and the connection string is read from App.config via ConfigurationManager. We are using L2E. Now I added a helper project, AndeDataViewer, to have a simple UI to display data from the database for testing/verification purpose. I don't want to create another set of
Configurationmanager Not Found
Entity Data Model in the helper project. I just added all related files as a link in the new helper project. When I compile, I got the following error: Error 15 The name 'ConfigurationManager' does not exist in the current context C:\workspace\SystemSoftware\SystemSoftware\src\systeminfo\RuntimeInfo.cs 24 40 AndeDataViewer I think I may need to add another project setting/config related file's link to the helper project from the main project? There is no App.config file in the new helper project. But it looks I cannot add that file's link to the helper project. Any ideas? c# linq entity-framework configurationmanager share|improve this question edited Apr 30 '10 at 14:55 asked Apr 30 '10 at 14:34 5YrsLaterDBA 8,1172387169 add a comment| 2 Answers 2 active oldest votes up vote 16 down vote accepted In your project, right-click, Add Reference... In the .NET tab, find the "System.Configuration" component name and click OK. "using System.Configuration" tells the compiler/IntelliSense to search in that namespace for any classes you use. Otherwise you would have to use the full name (System.Configuration.ConfigurationManager) every time. But if you don't add the reference, that namespace/class will not be found anywhere. Note that a DLL can have any namespace, so the file System.Configuration.dll could
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers configurationmanager.connectionstrings in c# or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x
Configuration Manager In C# Windows Application
Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it c# configurationmanager example only takes a minute: Sign up Error: The name 'ConfigurationManager' does not exist in the current context up vote 41 down vote favorite 3 I have included the following statement in my Visual C# Console Application (Visual Studio 2005 .NET http://stackoverflow.com/questions/2745213/how-to-avoid-the-name-configurationmanager-does-not-exist-in-the-current-cont 2.0 Framework) using System.Configuration; and I am using the following statement in my application: ConfigurationManager.AppSettings["SomeStringOverHere"]; I try to build the application and I get the error: The name 'ConfigurationManager' does not exist in the current context. Any help please? c# configurationmanager share|improve this question edited Nov 17 '09 at 19:15 Brandon 48.1k22140184 asked Nov 17 '09 at 19:14 zack 1,955123857 add a comment| 3 Answers 3 active oldest votes up vote 78 down vote accepted You need to reference System.Configuration.dll in http://stackoverflow.com/questions/1751087/error-the-name-configurationmanager-does-not-exist-in-the-current-context your project as well as the "using" statement. Namespaces are (sometimes) "split" across assemblies. That means that types in a single namespace are actually in different assemblies. To determine which assembly a BCL or FCL type is in, look it up on MSDN. If you look at the help for ConfigurationManager, you'll see that it specifies that it's in the System.Configuration assembly by looking near the top at "Assembly". This is the assembly you need to reference from your project share|improve this answer answered Nov 17 '09 at 19:16 Philip Rieck 26.4k66884 6 I have the same problem, I am using the "Using using System.Configuration;" and the reference as well... still dows not work... do I have to reference to the using System.Configuration.bll as well? where I can find it... is not in the add reference. Thank you ! –Gerardo Jaramillo Jan 28 '11 at 15:13 add a comment| up vote 15 down vote Philip was correct adding the reference helped me, but I actually went and tried to download the DLL because I did not know there was an easier way... right-click on 'add references' folder in the solution explorer select the '.NET' tab search for the .NET reference you would like to add (in this case System.Configuration) This post was very helpful to me, thanks to all. share|improve this answer answered Jun 29 '12 at 14:22 taybriz 913925 1 4. Add in the code "Im
Tips/Tricks Top Articles Beginner Articles Technical Blogs Posting/Update Guidelines Article Help Forum Article Competition Submit an article or tip Post your Blog quick answersQ&A Ask a Question View Unanswered http://www.codeproject.com/Questions/788278/The-name-ConfigurationManager-does-not-exist-in-th Questions View All Questions... C# questions Linux questions ASP.NET questions SQL questions VB.NET questions discussionsforums All Message Boards... Application Lifecycle> Running a Business Sales / Marketing Collaboration / Beta Testing Work Issues Design and Architecture ASP.NET JavaScript C / C++ / MFC> ATL / WTL / STL Managed C++/CLI C# Free Tools Objective-C and Swift Database Hardware & Devices> System Admin Hosting and Servers does not Java .NET Framework Android iOS Mobile SharePoint Silverlight / WPF Visual Basic Web Development Site Bugs / Suggestions Spam and Abuse Watch features Competitions News The Insider Newsletter The Daily Build Newsletter Newsletter archive Surveys Product Showcase Research Library CodeProject Stuff communitylounge Who's Who Most Valuable Professionals The Lounge The Insider News The Weird & The Wonderful The Soapbox Press Releases Non-English does not exist Language > General Indian Topics General Chinese Topics help What is 'CodeProject'? General FAQ Ask a Question Bugs and Suggestions Article Help Forum Site Map Advertise with us About our Advertising Employment Opportunities About Us Ask a Question All Questions All Unanswered FAQ The name 'ConfigurationManager' does not exist in the current context Rate this: Please Sign up or sign in to vote. See more: C# Hi, I have tried looking for help with regards to the question asked, and followed the advice or guidance found. using System.Configuration; if ((mtxUserName.Text != "") && (mtxPassword.Text != "")) { string constring = ConfigurationManager.ConnectionStrings["ConnData"].ConnectionString; SqlConnection con = new SqlConnection(constring); Keep getting error - The name 'ConfigurationManager' does not exist in the current context. Any help as to what I have been doing wrong? Posted 20-Jun-14 2:15am Saffa2003378 Add a Solution 3 solutions Top Rated Most Recent Rate this: Please Sign up or sign in to vote. Solution 2 Accept Solution Reject Solution 1. You should have added in the project references the next assembly: System.configuration 2. You should add in your code module: using System.Configuration; Then should work! Permalink Pos