简体   繁体   English

使用xsd.exe(VS2010)从xsd生成C#代码时发生StackOverFlowException

[英]StackOverFlowException when generating C# code from xsd using xsd.exe (VS2010)

I am trying to generate C# code from an XML schema with xsd.exe with Visual Studio RC1 (version 10.0.30128.1) but get the follwoing error: 我试图使用带有Visual Studio RC1(版本10.0.30128.1)的xsd.exe从XML模式生成C#代码,但是得到以下错误:

C:\\Development>xsd CR2008Schema.xsd /classes Microsoft (R) Xml Schemas/DataTypes support utility [Microsoft (R) .NET Framework, Version 4.0.30128.1] Copyright (C) Microsoft Corporation. C:\\ Development> xsd CR2008Schema.xsd / classes Microsoft(R)Xml架构/数据类型支持实用程序[Microsoft(R).NET Framework,版本4.0.30128.1]版权所有(C)Microsoft Corporation。 All rights reser 所有权利都需要

Process is terminated due to StackOverflowException. 由于StackOverflowException,进程终止。

The xsd is http://www.businessobjects.com/products/xml/CR2008Schema.xsd xsd是http://www.businessobjects.com/products/xml/CR2008Schema.xsd

Any help appreciated. 任何帮助赞赏。

Thanks, 谢谢,

Staffan 斯塔

This is probably happening because Group defines a collection of Group : 这可能发生,因为Group定义的收集Group

<!--    Group   -->
<xsd:complexType name="Group">
  <xsd:sequence>
    <xsd:element name="GroupHeader" type="HeaderFooter" minOccurs="0"/>
      <xsd:choice>
        <xsd:element name="Details" type="Details" minOccurs="0" maxOccurs="unbounded"/>
        <xsd:element name="Group" type="Group" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:choice>
    <xsd:element name="GroupFooter" type="HeaderFooter" minOccurs="0"/>
  </xsd:sequence>
  <xsd:attribute name="Level" type="xsd:integer" use="required"/>
</xsd:complexType>

xsd.exe is getting into an infinite loop... xsd.exe进入无限循环......

Further to Oded's answer there is a similar but more comples loop in the CrystalReport type. 继Oded的回答之后,CrystalReport类型中有一个类似但更复杂的循环。 The Details element of type Details contains a SubReport element that is of type Subreport, that inherits from CrystalReport, which contains a Details element of type Details etc. Details类型的Details元素包含一个SubReport类型的SubReport元素,它继承自CrystalReport,它包含Details类型的Details元素等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM