本文介绍了使用 SVCUTIL 生成数据合同代码时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

When i run the following command in the visual studio command prompt:

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

I'm using the following schema files:http://wiki.services.eoportal.org/tiki-download_wiki_attachment.php?attId=637&page=HMA-FO%20Deliverables

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

How can i get past this error?

推荐答案

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

Okay, so i've gotten past this error. (i get more now, but those are for another question).

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

I opened the ws-addr.xsd file in VS2010 and looked down the warnings list. one said:

警告 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"并下载了正确的并替换了它.

So i man went to "http://www.w3.org/2005/08/addressing/ws-addr.xsd" and downloaded the correct one and replaced it.

我不再收到警告 105,也不再收到 svcutil 的无法加载文件"错误

I no longer got the warning 105, and no longer get the "Could not load file" error with svcutil

这篇关于使用 SVCUTIL 生成数据合同代码时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 19:24