Configurationmanager 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 Learn more system.configuration.dll download about Stack Overflow the company Business Learn more about hiring developers or posting ads
Configurationmanager.connectionstrings In C#
with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow system.configuration.configurationmanager not found is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up System.Configuration.ConfigurationManager not available? up vote 37 down vote favorite 3 In a
The Name Configurationmanager Does Not Exist In The Current Context Class Library
VS2005 C# project I have added a reference to System.configuration. In the object browser, I can see the System.Configuration.ConfigurationManager. In Intellisense System.Configuration only has the old ConfigurationSettings, and not ConfigurationManager. My code System.Configuration.ConfigurationManager.AppSettings["MySetting"] is highlighted as a syntax error and does not compile. In a different project, the exact same setup works just fine... any clues as to what is going on? .net configurationmanager share|improve this question edited May 12 configurationmanager.dll download '09 at 9:51 finnw 32k1398175 asked May 12 '09 at 8:42 kpollock 1,47442337 what version of the framework are you targetting? –Mitch Wheat May 12 '09 at 8:49 add a comment| 7 Answers 7 active oldest votes up vote 93 down vote Although the using System.Configuration; command is automatically generated in the using section, for some reason the actual reference is not set. Go into add reference, .Net tab, and choose System.Configuration. ConfigurationManager will now be resolved. If you go to the project where the exact same setup works just fine and look at the references, you will see a reference to System.Configuration. share|improve this answer edited May 28 '09 at 16:09 answered May 13 '09 at 20:31 Lill Lansey add a comment| up vote 10 down vote accepted urgh - PICNIC error. Added ref to the wrong project in the solution... share|improve this answer answered May 12 '09 at 9:00 kpollock 1,47442337 4 my first thought just delete the question before anyone notices! ;) –kenny May 12 '09 at 9:55 1 it won't let me... to manhy answers. uess I'l just have to live with it! –kpollock May 12 '09 at 10:05 3 Dont worry, I just did the exa
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
System.configuration.dll Location
About Us Learn more about Stack Overflow the company Business Learn more about
Configuration Manager In C# Windows Application
hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss configurationmanager c# Join the Stack Overflow 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 The name 'ConfigurationManager' does http://stackoverflow.com/questions/851783/system-configuration-configurationmanager-not-available not exist in the current context up vote 259 down vote favorite 37 I am trying to access connectionStrings from the config file. The code is ASP.NET + C#. I have added System.Configuration to reference and also mentioned with using. But still it wouldn't accept the assembly. I am using VSTS 2008. Any idea what could be the reason? Another weird thing is the assembly http://stackoverflow.com/questions/1274852/the-name-configurationmanager-does-not-exist-in-the-current-context name shown as "System.configuration", a lower case c which is not how names are displayed for other System assemblies. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Configuration; namespace Utility { public class CommonVariables { public static String ConnectionString { get { return ConfigurationManager.ConnectionStrings["EmployeeEntities"].ConnectionString; } } } } Config:
resources Windows Server 2012 resources Programs https://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager.appsettings(v=vs.110).aspx MSDN subscriptions Overview Benefits Administrators Students Microsoft Imagine Microsoft Student Partners ISV Startups TechRewards Events Community Magazine Forums Blogs Channel 9 Documentation APIs and reference in c# Dev centers Retired content Samples We’re sorry. The content you requested has been removed. You’ll be auto redirected in 1 second. .NET Framework Class Library System.Configuration Namespaces System.Configuration System.Configuration ConfigurationManager Class configurationmanager.connectionstrings in c# ConfigurationManager Class ConfigurationManager Class ApplicationScopedSettingAttribute Class ApplicationSettingsBase Class ApplicationSettingsGroup Class AppSettingsReader Class AppSettingsSection Class CallbackValidator Class CallbackValidatorAttribute Class ClientSettingsSection Class CommaDelimitedStringCollection Class CommaDelimitedStringCollectionConverter Class Configuration Class ConfigurationAllowDefinition Enumeration ConfigurationAllowExeDefinition Enumeration ConfigurationCollectionAttribute Class ConfigurationConverterBase Class ConfigurationElement Class ConfigurationElementCollection Class ConfigurationElementCollectionType Enumeration ConfigurationElementProperty Class ConfigurationErrorsException Class ConfigurationException Class ConfigurationFileMap Class ConfigurationLocation Class ConfigurationLocationCollection Class ConfigurationLockCollection Class ConfigurationManager Class ConfigurationManager Methods ConfigurationManager Properties ConfigurationPermission Class ConfigurationPermissionAttribute Class ConfigurationProperty Class ConfigurationPropertyAttribute Class ConfigurationPropertyCollection Class ConfigurationPropertyOptions Enumeration ConfigurationSaveMode Enumeration ConfigurationSection Class ConfigurationSectionCollection Class ConfigurationSectionGroup Class ConfigurationSectionGroupCollection Class ConfigurationSettings Class ConfigurationUserLevel Enumeration ConfigurationValidatorAttribute Class ConfigurationValidatorBase Class ConfigXmlDoc
resources Windows Server 2012 resources Programs MSDN subscriptions Overview Benefits Administrators Students Microsoft Imagine Microsoft Student Partners ISV Startups TechRewards Events Community Magazine Forums Blogs Channel 9 Documentation APIs and reference Dev centers Retired content Samples We’re sorry. The content you requested has been removed. You’ll be auto redirected in 1 second. System.Configuration ConfigurationManager Class ConfigurationManager Properties ConfigurationManager Properties AppSettings Property AppSettings Property AppSettings Property AppSettings Property ConnectionStrings Property TOC Collapse the table of content Expand the table of content This documentation is archived and is not being maintained. This documentation is archived and is not being maintained. ConfigurationManager.AppSettings Property .NET Framework (current version) Other Versions Visual Studio 2010 .NET Framework 4 Visual Studio 2008 .NET Framework 3.5 .NET Framework 3.0 .NET Framework 2.0 Gets the AppSettingsSection data for the current application's default configuration.Namespace: System.ConfigurationAssembly: System.Configuration (in System.Configuration.dll)Syntax C#C++F#VB Copy public static NameValueCollection AppSettings { get; } Property Value Type: System.Collections.Specialized.NameValueCollectionReturns a NameValueCollection object that contains the contents of the AppSettingsSection object for the current application's default configuration. Exceptions Exception Condition ConfigurationErrorsExceptionCould not retrieve a NameValueCollection object with the application settings data.RemarksA AppSettingsSection object contains the contents of the configuration file's appSettings section.ExamplesThe first example shows a simple console application that reads application settings, adds a new setting, and updates an existing setting. C#VB Copy using System; using System.Configuration; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { ReadAllSettings(); ReadSetting("Setting1");