程序集解析器忽略PrivateBinPath [英] Assembly Resolver ignores PrivateBinPath

查看:273
本文介绍了程序集解析器忽略PrivateBinPath的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个要从appbase的子文件夹加载的程序集.我在创建AppDomain的过程中在PrivateBinPath中设置了该子文件夹.

I have an assembly I would like to load from a sub-folder of the appbase. I set that sub-folder in the PrivateBinPath during AppDomain creation.

问题是我在应用程序库中有相同DLL的另一个版本.从外观上看,解析器首先检测到错误的版本,指出存在不匹配并停止.结果,永远不会加载正确的版本(位于子文件夹中).

The issue is that I have another version of the same DLL in the appbase. From the way it looks, the resolver detects the wrong version first, says that there is a mismatch and stops. As a result the correct version (located in the sub-folder) never gets loaded.

我已经通过删除应用程序库中的那些DLL进行了测试,从而解决了该问题.即使找到了错误的版本,有什么方法可以强制搜索?

I have tested this by removing those DLLs in the appbase and it fixed the problem. Is there any way to force the search even if the wrong version is found?

推荐答案

您可以使用AppDomainSetup.PrivateBinPathProbe:

AppDomainSetup.PrivateBinPathProbe = "x"

只需将其设置为除null之外的其他值就足够了,另请参见此MSDN条目:

Just setting this to another value than null is enough, see also this MSDN entry:

http://msdn.microsoft.com/zh-我们/library/system.appdomainsetup.privatebinpathprobe.aspx

这篇关于程序集解析器忽略PrivateBinPath的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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