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

发布于 2024-08-31 21:29:07 字数 501 浏览 2 评论 0原文

我尝试使用 Visual Studio RC1(版本 10.0.30128.1)使用 xsd.exe 从 XML 模式生成 C# 代码,但出现以下错误:

C:\Development>xsd CR2008Schema.xsd /classes Microsoft (R) Xml 架构/数据类型支持实用程序 [Microsoft (R) .NET Framework,版本 4.0.30128.1] 版权所有 (C) 微软公司。 所有权限保留

由于 StackOverflowException,

进程被终止。 xsd 是 http://www.businessobjects.com/products/xml/CR2008Schema.xsd 。

任何帮助表示赞赏

谢谢,

斯塔凡

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:

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. All rights reser

Process is terminated due to StackOverflowException.

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

Any help appreciated.

Thanks,

Staffan

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

三生一梦 2024-09-07 21:29:08

除了 Oded 的回答之外,CrystalReport 类型中有一个类似但更复杂的循环。 Details 类型的Details 元素包含一个Subreport 类型的SubReport 元素,该元素继承自CrystalReport,其中包含Details 类型的Details 元素等。

Further to Oded's answer there is a similar but more comples loop in the CrystalReport type. 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.

古镇旧梦 2024-09-07 21:29:07

发生这种情况可能是因为 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 正在进入无限循环...

This is probably happening because Group defines a collection of 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...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文