无法加载文件或程序集或它的一个依赖 [英] Could not load file or assembly or one of its dependencies

查看:212
本文介绍了无法加载文件或程序集或它的一个依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在生命的又一个无法加载文件或程序集或它的一个依赖的问题。

  

信息:无法加载   文件或程序集   Microsoft.P​​ractices.Unity,   版本= 1.2.0.0,文化=中立,   公钥= 31bf3856ad364e35或   它的一个依赖。在位于   集清单定义呢   不匹配的程序集引用。   (从HRESULT异常:0x80131040)

我不知道是什么原因造成这样或我怎么会调试自己身上找原因。

我在我的解决方案目录的.csproj文件进行搜索,而每一个地方我都团结我有:

  

参考   包括=Microsoft.P​​ractices.Unity,   版本= 2.0.414.0,文化=中立,   公钥= 31bf3856ad364e35,   的ProcessorArchitecture = MSIL

找不到任何提及任何地方这违背1.2.0.0在我的任何项目。

任何想法,我应该如何去解决呢?

我会还就如何在常规调试这样的问题AP preciate提示。

解决方案
  1. 检查,如果你引用一个组件,它反过来引用的是旧版本统一。例如,让我们假设你有所谓的程序集 ServiceLocator.dll ,需要一个老版本的统一组装,现在当你引用服务定位你应该为它提供了旧版本统一,这使得这个问题。

  2. 可能是输出文件夹中的所有项目建立自己的组件,有一个老版本的统一。

您可以使用 FusLogVw ,以找出谁是装载旧的组件,只是定义路径日志,并运行您的解决方案,然后检查(在FusLogvw),其中统一程序集加载的第一线,双击它,看调用的组件,在这里你去。

I'm having another of these "Could not load file or assembly or one of its dependencies" problems.

Additional information: Could not load file or assembly 'Microsoft.Practices.Unity, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I have no idea what is causing this or how I could debug it to find the cause.

I've done a search in my solution catalogs .csproj files, and every where I have Unity I have:

Reference Include="Microsoft.Practices.Unity, Version=2.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"

Can't find any reference anywhere which goes against 1.2.0.0 in any of my projects.

Any ideas how I should go about solving this?

I would also appreciate tips on how to debug problems like this in general.

解决方案

  1. Check if you are referencing an assembly which in turn referencing an old version of unity. For example let's say you have an assembly called ServiceLocator.dll which needs an old version of Unity assembly, now when you reference the ServiceLocator you should provide it with the old version of Unity, and that makes the problem.

  2. May be the output folder where all projects build their assemblies, has an old version of unity.

You can use FusLogVw to find out who is loading the old assemblies, just define a path for the log, and run your solution, then check (in FusLogvw) the first line where the Unity assembly is loaded, double click it and see the calling assembly, and here you go.

这篇关于无法加载文件或程序集或它的一个依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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