Error: The name 'ConfigurationManager' does not exist in the current context

后端 未结 4 986
醉话见心
醉话见心 2021-02-04 23:06

I have included the following statement in my Visual C# Console Application (Visual Studio 2005 .NET 2.0 Framework)

using System.Configuration;

4条回答
  •  粉色の甜心
    2021-02-04 23:55

    You need to reference System.Configuration.dll in 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

提交回复
热议问题