我有一个用 C# 用 VS2010 编写的 Windows 窗体应用程序,在 app.config
文件中出现以下错误:
Message 4 Could not find schema information for the attribute 'name'
Message 8 Could not find schema information for the attribute 'name'
Message 12 Could not find schema information for the attribute 'name'
Message 5 Could not find schema information for the attribute 'serializeAs'
Message 15 Could not find schema information for the element 'CCP_Utility.Settings1'
Message 2 Could not find schema information for the element 'CCP_Utility.Properties.Settings'
Message 3 Could not find schema information for the element 'setting'
Message 1 Could not find schema information for the element 'userSettings'
Message 6 Could not find schema information for the element 'value'
我必须更改代码中的哪些内容才能解决此问题?我在哪里可以编辑 CCP_Utility.Settings1
和 CCP_Utility.Properties.Settings
中的内容?
这是 app.config
代码:
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="CCP_Utility.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="CCP_Utility.Settings1" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<userSettings>
<CCP_Utility.Properties.Settings>
<setting name="SourceDir" serializeAs="String">
<value />
</setting>
<setting name="TargetDir" serializeAs="String">
<value />
</setting>
<setting name="CorpID" serializeAs="String">
<value />
</setting>
</CCP_Utility.Properties.Settings>
<CCP_Utility.Settings1>
<setting name="sourceDir" serializeAs="String">
<value />
</setting>
<setting name="targetDir" serializeAs="String">
<value />
</setting>
</CCP_Utility.Settings1>
</userSettings>
</configuration>
最佳答案
解决问题的最快、最简单、最懒惰的方法:
- 在解决方案资源管理器中右键单击项目图标并选择“属性”。
- 转到“应用程序”选项卡并选择一个较早的 .NET 目标框架。
- 保存更改。
- 转到“应用程序”选项卡并选择初始 .NET 目标框架。
- 保存更改 => 问题已解决!
关于c# - 如何修复错误 : "Could not find schema information for the attribute/element" by creating schema,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5303476/