<用户设置>在 app.config 中找不到元素“userSettings”的架构信息;

发布于 2024-09-19 22:58:09 字数 1230 浏览 3 评论 0原文

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

例如:

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

  • 无法找到其架构信息 元素“setting”

  • 无法找到其架构信息 属性“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>

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

谢谢 Asaf

Hello when I try to add parameters to the settings table
I get multiple messages for each parameter I add.

e.g.:

  • Could not find schema information for
    the element 'userSettings'

  • Could not find schema information for
    the element 'setting'

  • Could not find schema information for
    the attribute 'serializeAs'

In the app.config I get:

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

I can use, edit and save this parameter, but the messages really annoy me.

I use the following schema (and selecting other like 20 and 30 did not help):

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

Any ideas?

edit:
following Hans post here is my 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>

I don't know what it is for and if I should change it - yet here it is :)

Thanks Asaf

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

握住你手 2024-09-26 22:58:09

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

不匹配,不确定它是如何实现的,您必须对其进行编辑成形。我猜你想重命名“project1”。否则请避免手动编辑 .config 文件。并确保您也具有所需的 元素。

Well, that doesn't look healthy. Note how it is not valid XML, the project... element is mismatched with RuthSiteManager...

Not sure how it got that way, you'll have to edit it into shape. I guess you want to rename "project1". Avoid editing the .config file by hand otherwise. And make sure you have the required <configSections> element as well.

墨小墨 2024-09-26 22:58:09

我刚刚遇到了同样的问题。我遇到的修复方法是执行“清理解决方案”,然后执行“重建解决方案”。这似乎正确地重建了文件。

I just had this same issue. The fix I came across was to do a 'Clean Solution' followed by a 'Rebuild Solution'. This seems to rebuild the files correctly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文