更新 webreference 会导致不同版本的 dll 出现问题
在我的应用程序中,我使用了一些 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在生成客户端代理时使用参考开关:
这将在
library.dll
中查找与 WSDL 中相同的类,并且不会在代理中重新创建它们(相同的类是指相同的命名空间和类型名称)。You could use the reference switch when generating your client proxy:
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).好吧,我自己找到了解决方案。
扩展必须部署在 GAC 中,并且必须更改 machine.config。
像这样的东西:
ok, I found the solution myself.
The extension must be deployed in the GAC and the machine.config must be changed.
something like this: