3

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

例如:

  • 找不到元素“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>

我不知道它是做什么用的,我是否应该改变它——但它就是这样 :)

谢谢阿萨夫

4

2 回答 2

2

嗯,这看起来不健康。请注意它是无效的 XML,项目...元素与RuthSiteManager 不匹配...

不知道它是怎么做到的,你必须把它编辑成形状。我猜你想重命名“project1”。否则,请避免手动编辑 .config 文件。并确保您也拥有所需的<configSections>元素。

于 2010-09-19T13:08:47.990 回答
0

我刚遇到同样的问题。我遇到的修复是先做一个“干净的解决方案”,然后是一个“重建解决方案”。这似乎可以正确重建文件。

于 2010-12-20T22:49:07.057 回答