无法加载文件或程序集“Microsoft.Practices.Unity” [英] Could not load file or assembly 'Microsoft.Practices.Unity'
问题描述
我试图统一
升级到版本(2.1.505.2),但是当我运行该应用程序我得到以下 FileLoadException
I am trying to upgrade Unity
to version (2.1.505.2), but when I run the application I get the following FileLoadException
无法加载文件或程序集Microsoft.Practices.Unity,
版本= 2.0.414.0,文化=中性公钥= 31bf3856ad364e35'
或它的一个依赖。
Could not load file or assembly 'Microsoft.Practices.Unity, Version=2.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
我们是从团结2.0.414.0升级到2.1 .505.2。
We are upgrading from Unity 2.0.414.0 to 2.1.505.2.
- 引用团结在解决方案中的所有项目引用指向DLL的正确版本
- 有在GAC引用没有统一的DLL。 (双通过检查检查
GACUTIL -l </ code>)
-
我删除从存档的所有统一的DLL。双使用PowerShell检查
- All project references in the solution that refer to Unity refer to the correct version of the dll
- There is no Unity dll referenced in the Gac. (double checked by checking
gacutil -l
) I removed all Unity dlls from the archive. Double checked with powershell
PS C:\> ls -rec -inc Microsoft.Practices.Unity.dll | foreach-object { "{0}`t{1}" -f $_.FullName, [System.Diagnostics.FileVersionInfo]::GetVersionInfo($_).FileVersion }
我怎样才能找出/谁仍然是指统一2.0.414.0?
How can I find out what / who still refers to the Unity 2.0.414.0?
FusionLogVw不告诉我哪个DLL导致了问题。
FusionLogVw doesn't tell me which DLL is causing the problem.
任何帮助深表感谢!
推荐答案
问题是另一个微软DLL,它指的是旧版本的统一。我发现了这一点成偶然来检查每个被引用的DLL的名称空间,发现包含命名空间与团结另一个DLL。
The problem was another Microsoft dll that refers to the old version of unity. I found this out be accident be checking the namespaces of every referenced dll, and found another dll that contained namespaces with "unity".
更新:
- Microsoft.Practices.EnterpriseLibrary.Common
- Microsoft.Practices.EnterpriseLibrary.Validation
到最新发布的版本解决了这个问题。
to latest released versions resolved the problem.
我希望我除了一些迷失的灵魂在那里谁也拉他的头发出过这个问题......这一天:)
I hope I save the day for some lost soul out there who's also pulling his hair out over this issue... :)
这篇关于无法加载文件或程序集“Microsoft.Practices.Unity”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!