After updating all of the NuGet packages, one of my applications started crashing on startup using FileLoadException :
Could not load file or assembly 'Microsoft.Practices.ServiceLocation, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
This was after upgrading ServiceLocation to version 1.3.0.0, and I double-checked all assemblies to make sure they were using this version. Then I ran Fuslogvw to diagnose the build, which was still referencing the old version:
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. ===
So, UnityExtensions (another NuGet package) still refers to the old version. But this should be good, because I added the bindingRedirect file to the app.config file:
<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>
But that doesn't seem to matter. My application is for .NET Framework 4.5.1, and I tried it with AutoGenerateBindingRedirects incl. And off In other words, I literally tried everything. What's going on here?
source share