首页 新闻 会员 周边

使用程序集重定向时,原始的程序集一定要存在吗?

0
[待解决问题]

我现在使用一个程序集,他引用了一个旧版本的程序集,这个程序集不存在,我想将他重定向到

新版本程序,这样能实现吗?

ntfyzjhtest123的主页 ntfyzjhtest123 | 菜鸟二级 | 园豆:204
提问于:2012-08-22 09:14
< >
分享
所有回答(3)
0

http://msdn.microsoft.com/zh-cn/library/7wd6ex19(v=vs.100)

重定向程序集版本

指定程序集位置 

Launcher | 园豆:45045 (高人七级) | 2012-08-22 09:28
0

这个不行,因为引用的程序集的元数据中有保存引用相关的key和签名信息,在加载引用程序集时会进行签名验证,验证不过导致失败。。。可参考:http://www.cnblogs.com/heyuquan/archive/2012/03/31/2427531.html

除非LZ将程序集与被引用的程序集一起重新编译,再发布出去。或则将程序集的引用源一起重定向到另外的程序集,具体如下

<configuration>

    <runtime>

        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

            <dependentAssembly>

                <assemblyIdentity name="asm6" publicKeyToken="c0……" />

                <bindingRedirect oldVersion="3.0.0.0" newVersion="2.0.0.0"/> 

            </dependentAssembly>

            <dependentAssembly> ……</dependentAssembly>

        </assemblyBinding>

    </runtime>

</configuration>
可参考:http://www.cnblogs.com/heyuquan/archive/2012/03/31/2427544.html

滴答的雨 | 园豆:3660 (老鸟四级) | 2012-08-22 10:17
0

重新引用一次?

chenping2008 | 园豆:9836 (大侠五级) | 2012-08-22 12:16
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册