c# - <userSettings> 在 app.config 中找不到元素 'userSettings' 的架构信息

标签 c# schema app-config settings.settings

你好,当我尝试将参数添加到设置表时 我添加的每个参数都会收到多条消息。

例如:

  • 找不到架构信息 元素“userSettings”

  • 找不到架构信息 元素“设置”

  • 找不到架构信息 属性“serializeAs”

在 app.config 中我得到:

<project1.Properties.Settings>
   <setting name="ccc" serializeAs="String">
      <value>vvv</value>
    </setting>
</project1.Properties.Settings>

我可以使用、编辑和保存这个参数,但是消息真的让我很烦。

我使用以下架构(选择其他架构,如 20 和 30 没有帮助):

C:\Program Files (x86)\Microsoft Visual Studio 9.0\xml\Schemas\DotNetConfig.xsd

有什么想法吗?

编辑: 以下是 Hans 的帖子,这是我的 configSections

<configSections>
    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
      <section name="project1.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
    </sectionGroup>
  </configSections>

我不知道它是做什么用的,也不知道我是否应该更改它 - 但它就在这里 :)

谢谢阿萨夫

最佳答案

嗯,这看起来不健康。请注意它不是有效的 XML,project... 元素与 RuthSiteManager...

不匹配

不确定它是如何变成这样的,你必须将它编辑成形状。我猜您想重命名“project1”。否则请避免手动编辑 .config 文件。并确保您拥有所需的 <configSections>元素也是如此。

关于c# - <userSettings> 在 app.config 中找不到元素 'userSettings' 的架构信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3745712/

相关文章:

c# - 使用 c# 运行带有 activex 对象的 dll

c# - PInvoke 样式传递带有成员动态指针数组的结构

c# - 远程桌面连接中的 SetForegroundWindow

c# - WPF:将 ComboBox 数据绑定(bind)到 int 值

mysql - 可视化数据库模式的好工具?

.net - 我们可以加密整个配置文件吗?

c# - 自定义配置部分的问题

javascript - 验证 url.format(urlObject)?

php - PDO MySQL 检查数据库是否存在

c# - 如何在 .net 应用程序中共享应用程序配置?