Unable to get link to ConfigurationManager

I just can't get Visual Studio 2005 to find the System.Configuration.ConfigurationManager class. Here is the code:

using System.Configuration;

...

x = ConfigurationSettings.AppSettings["MySetting"]
// The name 'ConfigurationManager' does not exist in the current context

x = System.Configuration.ConfigurationManager.AppSettings["MySetting"]
// The type or namespace name 'ConfigurationManager' does not exist in the
// namespace 'System.Configuration' (are you missing an assembly reference?)

I absolutely, positively do has a link to System.Configuration in the project and is definitely in the right project . The DLL is version 2.0.0.0 and the execution version 2.0.50727 is exactly the same as everyone else. I tried to remove the link and re-add it. It is strange that when it is displayed in the project’s “Links” folder, it appears as “System.configuration” - with a lowercase “c”.

Visual Studio System.Configuration.ConfigurationSettings - , . -, WebControl.

, ?

+3
2

"c" . . , , . , . , .

+2

System Assembly System.Configuration.dll?

IIRC AppSettings BCL, 2.0 ConfigurationManager .

+13

Source: https://habr.com/ru/post/1721648/


All Articles