VS2010:将设置添加到settings.settings会导致app.config架构错误
将设置添加到Settings.settings
:
导致 Visual Studio 2010创建一个 app.config
文件,并镜像其中的设置:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
[...snip...]
<userSettings>
<ContosoManagementSystem.Properties.Settings>
<setting name="foo" serializeAs="String">
<value>bar</value>
</setting>
</ContosoManagementSystem.Properties.Settings>
</userSettings>
</configuration>
但是当 Visual Studio 执行此操作时,Visual Studio 会抱怨 Visual Studio 不知道 Visual Studio 做了什么:
找不到属性“名称”的架构信息。
什么给?
请注意 类似问题不适用于此问题:
- Visual Studio 2010 与 Visual Studio 2008
- 接受的答案不起作用
有一些建议来更改 app.config
使用的架构:
Visual Studio 默认架构为 C:\Program Files (x86)\Microsoft Visual Studio 10.0\xml\Schemas\DotNetConfig.xsd
我尝试将其更改为其他架构:
“C:\Program Files (x86)\Microsoft Visual Studio 10.0\xml\Schemas\DotNetConfig30.xsd”
导致 VS 因
DotNetConfig30
本身而阻塞(复杂类型“configSection_section”已被声明。)"C:\Program Files (x86)\Microsoft Visual Studio 10.0\xml\Schemas\DotNetConfig.xsd" "C :\Program Files (x86)\Microsoft Visual Studio 10.0\xml\Schemas\DotNetConfig30.xsd"
导致 VS 因
DotNetConfig30
本身而阻塞(复杂类型“configSection_section”已被声明。)<代码>“C:\ Program Files(x86)\ Microsoft Visual Studio 10.0 \ xml \ Schemas \ DotNetConfig.xsd”“C:\ Program文件 (x86)\Microsoft Visual Studio 10.0\xml\Schemas\DotNetConfig20.xsd" "C:\Program Files (x86)\Microsoft Visual Studio 10.0\xml\Schemas\DotNetConfig30.xsd" "C:\Program Files (x86) \Microsoft Visual Studio 10.0\xml\Schemas\DotNetConfig35.xsd"
导致 VS 因
DotNetConfig30
本身而阻塞(复杂类型“configSection_section”已被声明。)
如何使 Visual Studio 2010 不会因编辑时 Visual Studio 2010 执行的操作而给出错误Visual Studio 2010 中的某些内容。
Ian Boyd 正在恶化。
Adding a setting to Settings.settings
:
causes Visual Studio 2010 to create an app.config
file, and mirror the settings in it:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
[...snip...]
<userSettings>
<ContosoManagementSystem.Properties.Settings>
<setting name="foo" serializeAs="String">
<value>bar</value>
</setting>
</ContosoManagementSystem.Properties.Settings>
</userSettings>
</configuration>
But when Visual Studio does this, Visual Studio complains that Visual Studio doesn't know what Visual Studio did:
Could not find schema information for the attribute 'name'.
What gives?
Note the similar question that doesn't apply to this question:
- Visual Studio 2010 vs Visual Studio 2008
- accepted answer doesn't work
There some suggestions to alter the schemas used by app.config
:
Visual Studio default schema to C:\Program Files (x86)\Microsoft Visual Studio 10.0\xml\Schemas\DotNetConfig.xsd
i've tried changing it to other schemas:
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\xml\Schemas\DotNetConfig30.xsd"
causes VS to choke on
DotNetConfig30
itself (The complexType 'configSection_section' has already been declared.)"C:\Program Files (x86)\Microsoft Visual Studio 10.0\xml\Schemas\DotNetConfig.xsd" "C:\Program Files (x86)\Microsoft Visual Studio 10.0\xml\Schemas\DotNetConfig30.xsd"
causes VS to choke on
DotNetConfig30
itself (The complexType 'configSection_section' has already been declared.)"C:\Program Files (x86)\Microsoft Visual Studio 10.0\xml\Schemas\DotNetConfig.xsd" "C:\Program Files (x86)\Microsoft Visual Studio 10.0\xml\Schemas\DotNetConfig20.xsd" "C:\Program Files (x86)\Microsoft Visual Studio 10.0\xml\Schemas\DotNetConfig30.xsd" "C:\Program Files (x86)\Microsoft Visual Studio 10.0\xml\Schemas\DotNetConfig35.xsd"
causes VS to choke on
DotNetConfig30
itself (The complexType 'configSection_section' has already been declared.)
How do i make Visual Studio 2010 not give errors as a result of something Visual Studio 2010 did when i editing something in Visual Studio 2010.
Ian Boyd is getting aggravated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论