【问题标题】:Configuration members missing from intellisense智能感知中缺少配置成员
【发布时间】:2009-02-11 19:15:08
【问题描述】:

我目前正在尝试为我的应用程序创建一个自定义 ConfigurationSection,但是 VS2008 无法识别每个人和 MSDN 所说的任何成员。我唯一看到的是 ConfigurationException。

using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Xml;

namespace CSharpIrcBot
{

    public class ServerSettings : ConfigurationSection
    {

    }
}

我正在尝试创建一个包含以下数据的部分,我可以从应用程序中读取和更新这些数据。这些将是用户设置。

服务器名、端口 (int)、实名、昵称、用户名、模式掩码

问题不在于我无法弄清楚如何使用,而是我无法甚至无法使用 ConfigurationSection。所以我的问题是……它去哪儿了?

我似乎也缺少 ConfigurationManager...它不会在智能感知中任何地方显示。

【问题讨论】:

    标签: c# configuration c#-3.0


    【解决方案1】:

    您可能需要添加对“System.Configuration”程序集的引用。您可以在“[windowsfolder]\Microsoft.NET\Framework[framework version]\”中找到它。您可能看起来拥有 System.Configuration 命名空间,因为智能感知在其中显示了一些对象,但在您手动添加引用之前,您不会获得所有对象。

    【讨论】:

    • 就是这样......我以前从未遇到过这种情况......通常它会自动添加它。
    • 不久前我也遇到过这种情况——我也很困惑。
    猜你喜欢
    • 2012-03-06
    • 1970-01-01
    • 2019-02-25
    • 2013-01-24
    • 2015-01-05
    • 1970-01-01
    • 2017-02-15
    • 2019-11-01
    • 1970-01-01
    相关资源
    最近更新 更多