更新 webreference 会导致不同版本的 dll 出现问题

发布于 2024-08-11 22:39:19 字数 291 浏览 3 评论 0原文

在我的应用程序中,我使用了一些 dll,比如说 library.dll,版本 1.0 在我的webservice中,我也使用library.dll,但是2.0版本

当我更新webreference时,dll内部的类也会在webreference中生成。

这会带来麻烦,因为在我的应用程序中,dll 中定义的类现在也在引用中可用,并且存在不匹配。

我该如何解决这个问题?我需要能够告诉 Web 服务在以一种或另一种方式更新 Web 引用时忽略 DLL 代码。

我使用 Visual Studio 2008。

In my application, I use some dll, let's say library.dll, version 1.0
In my webservice, I also use library.dll, but version 2.0

When I do an update of the webreference, the classes inside of the dll are also generated in the webreference.

And this gives troubles because in my application, the classes that are defined in the dll now are also available in the reference and there is a mismatch.

How can I solve this? I need to be able to tell the webservice to ignore the dll-code when updating the webreference in the one or the other way.

I use Visual Studio 2008.

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

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

发布评论

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

评论(2

情场扛把子 2024-08-18 22:39:19

您可以在生成客户端代理时使用参考开关:

svcutil.exe /reference:c:\library.dll http://example.com/service.svc?wsdl

这将在 library.dll 中查找与 WSDL 中相同的类,并且不会在代理中重新创建它们(相同的类是指相同的命名空间和类型名称)。

You could use the reference switch when generating your client proxy:

svcutil.exe /reference:c:\library.dll http://example.com/service.svc?wsdl

This will look for classes in library.dll that are the same in the WSDL and it won't recreate them in the proxy (By same classes I mean same namespace and type name).

情定在深秋 2024-08-18 22:39:19

好吧,我自己找到了解决方案。

扩展必须部署在 GAC 中,并且必须更改 machine.config。

像这样的东西:

<system.xml.serialization>
    <schemaImporterExtensions>
      <add name="SchemaImporterExtensions"
           type="Library.DesignTime.SchemaImporterExtension,
                 Library.Framework.DesignTime" />
    </schemaImporterExtensions>
</system.xml.serialization>

ok, I found the solution myself.

The extension must be deployed in the GAC and the machine.config must be changed.

something like this:

<system.xml.serialization>
    <schemaImporterExtensions>
      <add name="SchemaImporterExtensions"
           type="Library.DesignTime.SchemaImporterExtension,
                 Library.Framework.DesignTime" />
    </schemaImporterExtensions>
</system.xml.serialization>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文