.NET程序集绑定,可我装配映射到一个版本的另一个程序集? [英] .NET assembly binding, can I map an assembly to a version in another assembly?

查看:134
本文介绍了.NET程序集绑定,可我装配映射到一个版本的另一个程序集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

早上好, 是否有可能装配请求映射到另一个组件内的版本?比如我们的产品采用的NHibernate 3.2。我们正在向NServiceBus 3.2.2。对于DBSubscription存储它使用NHibernate和它的烤版的NHibernate这是NServiceBus.NHibernate 3.3。

Good Morning, Is it possible to map assembly requests to the version within another assembly? For instance our product uses NHibernate 3.2. We are moving to NServiceBus 3.2.2. For DBSubscription storage it uses NHibernate and it's baked in version of NHibernate which is 3.3 in NServiceBus.NHibernate.

我如何可以映射为NHibernate的3.2.0.2002要NServiceBus.NHibernate是3.3 ...请求

How can I map requests for NHibernate 3.2.0.2002 to NServiceBus.NHibernate which is 3.3...

<assemblyIdentity name="NHibernate"
                          publicKeyToken="aa95f207798dfdb4"
                          culture="neutral" />
        <bindingRedirect oldVersion="3.2.0.2002"
                         newVersion="3.3.0.4000"/> //I need it to be NServiceBus.NHibernate

感谢您的任何提示和技巧。样品和链接总是AP preciated。

Thanks for any tips or tricks. Samples and Links are always appreciated.

谢谢大家!

推荐答案

在你的绑定重定向可以使用的 codeBase的 元素:

In your binding redirect you can redirect to a different code base using the codeBase element:

<dependentAssembly>
    <assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral" />
    <bindingRedirect oldVersion="3.2.0.2002" newVersion="3.3.0.4000"/>
    <codeBase version="3.3.0.4000" href="file:///C:/path/to/assembly.dll" />
</dependentAssembly>

公钥必须然而是相同的,。你不能绑定到与一个不同的密钥签名不同的装配。

The public keys must be the same, however. You can not bind to a different assembly that is signed with a different key.

如果该键是不同的,那么你需要重新编译反对NServiceBus.NHibernate您的解决方案。

If the keys are different, then you need to recompile your solution against NServiceBus.NHibernate.

这篇关于.NET程序集绑定,可我装配映射到一个版本的另一个程序集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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