你好,当我尝试将参数添加到设置表时 我添加的每个参数都会收到多条消息。
例如:
找不到架构信息 元素“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/