Cha*_*lie 5 .net c# unity-container nuget
在更新了所有NuGet包后,我的一个应用程序开始崩溃,启动时出现FileLoadException:
Could not load file or assembly 'Microsoft.Practices.ServiceLocation, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
Run Code Online (Sandbox Code Playgroud)
这是在升级ServiceLocation到版本1.3.0.0之后,我仔细检查了所有程序集以确保它们使用该版本.然后我跑去Fuslogvw诊断仍然引用旧版本的程序集:
LOG: DisplayName = Microsoft.Practices.ServiceLocation, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///C:/Users/Charlie/AppData/Local/Programs/MyClient/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = MyClient.exe
Calling assembly : Microsoft.Practices.Prism.UnityExtensions, Version=5.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
Run Code Online (Sandbox Code Playgroud)
因此,UnityExtensions(另一个NuGet包)仍然引用旧版本.但那应该没问题,因为我已经bindingRedirect在我的app.config文件中添加了一个:
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Practices.ServiceLocation" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.2.0.0" newVersion="1.3.0.0" />
</dependentAssembly>
</assemblyBinding>
Run Code Online (Sandbox Code Playgroud)
但这似乎没有任何区别.我的应用程序是针对.NET Framework 4.5.1的,我已经尝试过AutoGenerateBindingRedirectson-off.换句话说,我已经尝试了一切.这里发生了什么?
| 归档时间: |
|
| 查看次数: |
2491 次 |
| 最近记录: |