如何查找依赖于特定依赖项的特定版本的内容?

发布于 2024-10-15 12:36:19 字数 2093 浏览 3 评论 0原文

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

无法加载文件或程序集 '温莎城堡,版本=2.1.0.0, 文化=中立, 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, Version=2.5.1.0

我理解正确吗?

=== 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.

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

九公里浅绿 2024-10-22 12:36:19

您可以使用 Fuslogvw.exe 实用程序,它将为您提供有关以下方面的更多信息:调用程序集。 Scott Hansleman 还在博客中介绍了这一点

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

提赋 2024-10-22 12:36:19

您是否查看过程序集绑定日志查看器(Fuslogvw.exe)?

这应该提供所需的所有信息。

请参阅 MSDN

Have you looked at the assembly binding log viewer (Fuslogvw.exe)?

This should provide all the information needed.

See on MSDN.

硬不硬你别怂 2024-10-22 12:36:19

FusionLog 工具 是解决此类问题的最佳工具,但有时只能指出到你的代码。尝试调高 MSBuild 的详细程度,您也许能够跟踪到编译失败时的位置。

FusionLog tool is best tool for things like that, but sometimes will only point to your code. Try turning up the verbosity for MSBuild and you might be able to track it down to where the compilation is at when it fails.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文