App.config问题(架构)

时间:2013-06-13 18:39:34

标签: c# visual-studio-2010 app-config

我的控制台应用程序中的app.config文件出现了这个问题。

这是我的app.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
      <section name="PROJECTNAME.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
    </sectionGroup>
  </configSections>
  <userSettings>
    <PROJECTNAME.Properties.Settings>
      <setting name="SETTING1" serializeAs="String">
        <value>stringvariable</value>
      </setting>
      <setting name="SETTING2" serializeAs="String">
        <value>boolvariable</value>
      </setting>
      <setting name="SETTING3" serializeAs="String">
        <value>intvariable</value>
      </setting>
    </PROJECTNAME.Properties.Settings>
  </userSettings>
</configuration>

如果我只有默认架构(DotNetConfig.xsd),我会收到以下警告:

Message 1   Could not find schema information for the element 'userSettings'.   PROJECTPATH\App.config
Message 2   Could not find schema information for the element 'PROJECTNAME.Properties.Settings'.    PROJECTPATH\App.config
Message 3   Could not find schema information for the element 'setting'.    PROJECTPATH\App.config
Message 4   Could not find schema information for the attribute 'name'. PROJECTPATH\App.config
Message 5   Could not find schema information for the attribute 'serializeAs'.  PROJECTPATH\App.config
Message 6   Could not find schema information for the element 'value'.  PROJECTPATH\App.config

消息3-6重复3次。

如果我转到XML&gt;创建模式,它创建一个app.xsd,但它给了我另一个警告:

 Warning    1   The global element 'configuration' has already been declared.   App.xsd

我一直试图解决这个问题几天,没有结果。而且我找不到使用Google的解决方案

0 个答案:

没有答案