【问题标题】:Problem generating data contract code with SVCUTIL使用 SVCUTIL 生成数据合约代码时出现问题
【发布时间】:2011-06-03 00:20:49
【问题描述】:

当我在 Visual Studio 命令提示符下运行以下命令时:

D:\Documents\DEV\SARPilot\Docs\eoschema\schema\OrderSchema>svcutil /t:code /language=C# *.wsdl *.xsd ..\ws-addressing\*.xsd ..\gml\3.1.1\base\*.xsd ..\ows\1.0.0\*.xsd ..\xlink\1.0.0\*.xsd ..\swe\sweCommon\0.0.0\*.xsd /out:MyServiceProxy.cs /config:MyServiceProxy.config

我收到以下错误:

Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 4.0.30319.1]
Copyright (c) Microsoft Corporation.  All rights reserved.

Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 4.0.30319.1]
Copyright (c) Microsoft Corporation.  All rights reserved.

Error: Cannot read ..\ws-addressing\*.xsd.

    Cannot load file D:\Documents\DEV\SARPilot\Docs\eoschema\schema\ws-addressing\ws-addr.xsd as an Assembly. Check the FusionLogs
 for more Information.

    Could not load file or assembly 'file:///D:\Documents\DEV\SARPilot\Docs\eoschema\schema\ws-addressing\ws-addr.xsd' or one of i
ts dependencies. The module was expected to contain an assembly manifest.

If you would like more help, type "svcutil /?"

我正在使用以下架构文件: http://wiki.services.eoportal.org/tiki-download_wiki_attachment.php?attId=637&page=HMA-FO%20Deliverables

我怎样才能克服这个错误?

【问题讨论】:

  • 我不确定,但尝试将所有开关放在一起,然后按照所有文件路径。
  • 不,同样的事情,谢谢。

标签: .net visual-studio wcf svcutil.exe ogc


【解决方案1】:

好的,所以我已经克服了这个错误。 (我现在得到更多,但这些是另一个问题)。

我在 VS2010 中打开了 ws-addr.xsd 文件并查看了警告列表。有人说:

警告 105 XML 编辑器试图 将此 DTD 转换为 XSD,以便它可以 提供验证和智能感知 在您键入时,但它不能 创建一个有效的 XSD 架构。可能 此 DTD 使用不 映射到 XSD。你也许可以得到 有关该问题的更多信息 使用创建模式 命令。 D:\Documents\DEV\SARPilot\Docs\eoschema\schema\ws-addressing\ws-addr.xsd 3 11 D:...\schema\

所以我去了“http://www.w3.org/2005/08/addressing/ws-addr.xsd”并下载了正确的并替换了它。

我不再收到警告 105,并且不再收到 svcutil 的“无法加载文件”错误

【讨论】:

    猜你喜欢
    • 2011-05-25
    • 2014-04-15
    • 1970-01-01
    • 2011-08-23
    • 2019-10-23
    • 1970-01-01
    • 2014-05-06
    • 1970-01-01
    相关资源
    最近更新 更多