多个版本的dll for WCF服务,两个服务暴露 [英] multiple versions of dll for WCF service with two services exposed

查看:203
本文介绍了多个版本的dll for WCF服务,两个服务暴露的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在同一个解决方案中有2个wcf项目。两个参考libraryX,但使用不同的版本。当部署时,这两个服务都在同一个文件夹中具有相同的bin文件夹,因此我有两个DLL被称为libraryX.dll的问题。在内部,它们有不同的版本,所以我可以重命名一个物理文件名?如果没有,最好的方法是什么?

解决方案

您可以尝试通过更改当前AppDomain的RelativeSearchPath来更改PrivateBinPath AppDomainSetup。



http://msdn.microsoft.com/en-us/library/system.appdomain.aspx



移动旧的(或更新的)程序集文件到您的应用程序基础下的子文件夹。



所以有一个结构如:
c:\myapp\bin [all curent files]
c: \myapp\bin\older [旧图书馆]



在代码中:

  AppDomain.CurentDomain.SetupInformation.PrivateBinPath =旧; 


I have 2 wcf projects in the same solution. both reference libraryX, but use different versions. when deployed, both services are in the same folder with the same bin folder, so I have an issue with both DLLs being called libraryX.dll. Internally, they have a different version, so can I just rename the physical filename of one? If not, what is the best approach?

解决方案

You can try setting the RelativeSearchPath for the current AppDomain by changing the PrivateBinPath on the AppDomainSetup.

http://msdn.microsoft.com/en-us/library/system.appdomain.aspx

And move the older (or newer) assembly file to a subfolder under your application base.

so have a structure like: c:\myapp\bin [all curent files] c:\myapp\bin\older [the older library]

In code:

AppDomain.CurentDomain.SetupInformation.PrivateBinPath = "older";

这篇关于多个版本的dll for WCF服务,两个服务暴露的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆