C# XML架构编译错误-intellisense不可用

C# XML架构编译错误-intellisense不可用,c#,xml,vb.net,C#,Xml,Vb.net,我遇到了以下XML验证错误(翻译成英文): 当我执行使用此xds的应用程序时,我看到以下警告消息(将其翻译为英语): 当我单击警告消息时,它会生成另外6个验证错误。当我找到其中一个的源(在xds文件中)时,它会将我指向以下一个: <xs:attribute name="forms_Id" msdata:AutoIncrement="true" msprop:Generator_UserColumnName="forms_Id" msprop:Generator_ColumnPropName

我遇到了以下XML验证错误(翻译成英文):

当我执行使用此xds的应用程序时,我看到以下警告消息(将其翻译为英语):

当我单击警告消息时,它会生成另外6个验证错误。当我找到其中一个的源(在xds文件中)时,它会将我指向以下一个:

<xs:attribute name="forms_Id" msdata:AutoIncrement="true" msprop:Generator_UserColumnName="forms_Id" msprop:Generator_ColumnPropNameInRow="forms_Id" msprop:Generator_ColumnVarNameInTable="columnforms_Id" msprop:Generator_ColumnPropNameInTable="forms_IdColumn" type="xs:int" msdata:AllowDBNull="false" use="prohibited" />

在xds文件中,它看起来如下所示(仅是50多页xml文件大小中的前几个相似项):

"<xs:schema id="MySetting" targetNamespace="http://tempuri.org/S...MySetting.xsd" xmlns:mstns="http://tempuri.org/S...MySetting.xsd" xmlns="http://tempuri.org/S...MySetting.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified" msdata:schemafragmentcount="2">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections />
        <Tables />
        <Sources />
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="MySetting" msdata:IsDataSet="true""

请仅对可执行代码使用堆栈片段。要定期格式化代码,只需按四个空格缩进或突出显示并单击
{}
按钮。听起来您的XML建模与您的类不完全相同。也就是说,您的“forms_Id”元素是其子元素/后代的某个XML元素具有“use”属性。因此父/祖先具有“使用”属性,而子具有“使用”属性。但是您的类被建模为您的子类应该从其父/祖先继承该属性。如果正确,您需要重新建模XML或类,使它们彼此对齐。如果我理解,子类不需要使用“use”属性。它应该从父级继承。为了清楚起见,让我在上面的问题中添加关系信息。请仅对可执行代码使用堆栈片段。要定期格式化代码,只需按四个空格缩进或高亮显示并单击
{}
按钮。听起来您的XML不像您的类那样建模。也就是说,您的“forms\u Id”元素是其子元素/后代的某个XML元素具有“use”属性。因此父元素/祖先元素具有“use”属性,而子元素具有“use”属性。但是您的类被建模为您的子类应该从其父/祖先继承该属性。如果正确,您需要重新建模XML或类,使它们彼此对齐。如果我理解,子类不需要使用“use”属性。它应该从父级继承它。为了清楚起见,让我在上面的问题中添加关系信息
<xs:attribute name="forms_Id" msdata:AutoIncrement="true" msprop:Generator_UserColumnName="forms_Id" msprop:Generator_ColumnPropNameInRow="forms_Id" msprop:Generator_ColumnVarNameInTable="columnforms_Id" msprop:Generator_ColumnPropNameInTable="forms_IdColumn" type="xs:int" msdata:AllowDBNull="false" use="prohibited" />
"<xs:schema id="MySetting" targetNamespace="http://tempuri.org/S...MySetting.xsd" xmlns:mstns="http://tempuri.org/S...MySetting.xsd" xmlns="http://tempuri.org/S...MySetting.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified" msdata:schemafragmentcount="2">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections />
        <Tables />
        <Sources />
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="MySetting" msdata:IsDataSet="true""