“无法加载文件或程序集"错误,但我不知道哪个项目使用旧编号引用此程序集 [英] "Could not load file or assembly" error but I don't know which project is referencing this assembly with old number

查看:21
本文介绍了“无法加载文件或程序集"错误,但我不知道哪个项目使用旧编号引用此程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我启动我的 WPF 应用程序时,我收到错误无法加载文件或程序集 'ASSEMBLY_NAME,版本 = 0.4010.4609.26378,Culture=neutral,PublicKeyToken='XXX' 或其依赖项之一.找到的程序集的清单定义与程序集引用不匹配.(来自 HRESULT 的异常:0x80131040)".

When I am launching my WPF application, I got the error "Could not load file or assembly 'ASSEMBLY_NAME, Version=0.4010.4609.26378, Culture=neutral, PublicKeyToken='XXX' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)".

ASSEMBLY_NAME 是一个项目的名称,它被许多其他项目引用,因为它是一个核心.我的 WPF 项目也引用了它,一些引用 ASSEMBLY_NAME 的项目是我的 WPF 项目的引用.但是,WPF 项目及其引用 ASSEMBLY_NAME 的引用都引用了 0.4010.4610.xxxx 版本.因此,即使我明白为什么会发生这个错误——这是因为目标是旧版本,但我只有新版本,我无法找出哪个项目或部分引用了 0.4010.4609.xxxx 版本.正如我提到的,启动项目,我的 WPF 项目不是.谁能告诉我如何检查谁在引用它?谢谢.

The ASSEMBLY_NAME is the name of one project, which is referenced by many other projects because it is a core. My WPF project is also referencing it, and some projects referencing ASSEMBLY_NAME are references of my WPF project. However, both WPF project and its references which are referencing ASSEMBLY_NAME, they all reference the version 0.4010.4610.xxxx. So even though I understand why this error happens--it's because an older version is the target however I only have newer version, I can't find out which project or part is referencing the version 0.4010.4609.xxxx. As I mentioned, the startup project, my WPF project is not. Could anyone tell me how to check who is referencing it? Thanks.

推荐答案

您可以检查对 ASSEMBLY_NAME 的每个引用的属性,并验证您看到的路径是否类似于 ASSEMBLY_NAMEinDebug 和不是 PROJECT_CONTAINING_THE_REFERENCEinDebug.

You can check the properties of each reference to ASSEMBLY_NAME and verify that the path you see is something like ASSEMBLY_NAMEinDebug and not PROJECT_CONTAINING_THE_REFERENCEinDebug.

或者,您可以删除项目中的所有 binobj 文件夹并执行全部重建.您的项目之一应该无法构建.那就是引用错误的那个.

Alternatively you can delete all your bin and obj folders in the projects and do a Rebuild All. One of your projects should fail building. That's the one with the wrong reference.

这篇关于“无法加载文件或程序集"错误,但我不知道哪个项目使用旧编号引用此程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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