如何找到什么依赖于特定依赖的具体版本? [英] How to find what depends on a specific version of a specific dependency?

查看:199
本文介绍了如何找到什么依赖于特定依赖的具体版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行我的应用程序(不在编译时),我收到此错误:


无法加载文件或程序集
'Castle.Windsor,Version = 2.1.0.0,
Culture = neutral,
PublicKeyToken = 407dd0808d44fbdc'或
其依赖关系之一。位于
程序集的清单定义
与程序集引用不匹配。
(HRESULT的异常:0x80131040)


我的解决方案有许多项目,尽可能使用项目引用,但其中一些项目具有外部依赖关系的汇编引用。



如何轻松找出哪个项目正在寻找这个特定版本的 Castle.Windsor.dll ?我没有这个版本,我试图使用2.5.2(最新),所以我想找到罪魁祸首并更新它使用最新的。



非常感谢提前。



更新

我在下面添加了一个消毒的Fusion日志。似乎告诉我, Caliburn.Castle 需要 Castle.Windsor,Version = 2.1.0.0 (这将是一个错误,因为我使用2.5),但Fusion组装探测实际发现 Castle.Windsor,版本= 2.5.1.0



我明白了吗?

  ===预绑定状态信息=== 
LOG:User = Barney\\\
eil
日志:DisplayName = Castle.Windsor,Version = 2.1.0.0,Culture = neutral,PublicKeyToken = 407dd0808d44fbdc
(完全指定)
日志:Appbase = file:/// [我的exe的调试文件夹]
日志:初始PrivatePath = NULL
日志:动态Base = NULL
日志:缓存基础=空
日志:AppName = [我的exe的文件名]
调用程序集:Caliburn.Castle,Version = 1.1.0.0,Culture = neutral,PublicKeyToken = 8e5891231f2ed21f。
===
日志:此绑定在默认加载上下文中启动。
日志:使用应用程序配置文件:[为我的exe配置文件]
日志:使用主机配置文件:
日志:使用C:\Windows\Microsoft.NET的机器配置文件\Framework\v4.0.30319\config\machine.config。
日志:政策后引用:Castle.Windsor,Version = 2.1.0.0,Culture = neutral,PublicKeyToken = 407dd0808d44fbdc
日志:GAC查找失败。
日志:尝试下载新的URL文件:/// [我的exe的Debug文件夹] /Castle.Windsor.DLL。
日志:装配下载成功。尝试安装文件:[我的exe的调试文件夹] \Castle.Windsor.dll
日志:进入从源代码设置阶段。
日志:汇编名称是:Castle.Windsor,Version = 2.5.1.0,Culture = neutral,PublicKeyToken = 407dd0808d44fbdc
WRN:比较汇编名称导致不匹配:次要版本
ERR:程序集引用与发现的程序集定义不匹配。
ERR:无法完成装配设置(hr = 0x80131040)。探测终止


解决方案

您可以使用 Fuslogvw.exe实用程序,它将为您提供有关调用程序集的更多信息。 Scott Hansleman也发布了该信息


I'm getting this error when I run my app (not at compile time):

Could not load file or assembly 'Castle.Windsor, Version=2.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

My solution has many projects, using project references where possible, but some of those projects have assembly references to external dependencies.

How can I easily find out which project is looking for this specific version of Castle.Windsor.dll? I don't have that version and am trying to use 2.5.2 (latest), so I want to find the culprit and update it to use the latest one.

Many thanks in advance.

UPDATE
I've added a sanitised Fusion log below. It appears to be telling me that Caliburn.Castle requires Castle.Windsor, Version=2.1.0.0 (which would be a mistake as I'm using 2.5), but Fusion assembly probing as actually finding Castle.Windsor, Version=2.5.1.0 instead.

Have I understood that correctly?

=== Pre-bind state information ===
LOG: User = Barney\neil
LOG: DisplayName = Castle.Windsor, Version=2.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc
 (Fully-specified)
LOG: Appbase = file:///[Debug folder of my exe]
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = [Filename of my exe]
Calling assembly : Caliburn.Castle, Version=1.1.0.0, Culture=neutral, PublicKeyToken=8e5891231f2ed21f.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: [Config file for my exe]
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Castle.Windsor, Version=2.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///[Debug folder of my exe]/Castle.Windsor.DLL.
LOG: Assembly download was successful. Attempting setup of file: [Debug folder of my exe]\Castle.Windsor.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Castle.Windsor, Version=2.5.1.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: The assembly reference did not match the assembly definition found.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

解决方案

You could use the Fuslogvw.exe utility which will provide you more information on the calling assembly. Scott Hansleman also blogged about it.

这篇关于如何找到什么依赖于特定依赖的具体版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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