1

"Could not load file or assembly 'GalaSoft.MvvmLight, Version=5.4.1.0, Culture=neutral, PublicKeyToken=0ffbc31322e9d308' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"GalaSoft.MvvmLight, Version=5.4.1.0, Culture=neutral, PublicKeyToken=0ffbc31322e9d308"

I get the above error when trying to instantiate a class which uses the MvvmLightLibs library from a .NET Framework 4.6.1 WPF Application.

Adding a binding redirect does not resolve the issue, and the version of the .dll in the bin folder is 5.4.1.0, which is the same as the missing assembly in the error message.

<dependentAssembly>
        <assemblyIdentity name="GalaSoft.MvvmLight" publicKeyToken="0ffbc31322e9d308" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-5.4.1.0" newVersion="5.4.1.0"/>
</dependentAssembly>
Doove
  • 11
  • 2
  • Does this problem manifests while running from Visual Studio? Or when you open by exe? Did you use Nuget Package Manager to install the package? – Lupu Silviu Aug 30 '18 at 13:50
  • Possible duplicate of [Could not load file or assembly or one of its dependencies](https://stackoverflow.com/questions/4469929/could-not-load-file-or-assembly-or-one-of-its-dependencies) – ste-fu Aug 30 '18 at 13:52
  • @LupuSilviu yes - from VS, and package was installed from Nuget Package Manager – Doove Aug 30 '18 at 14:07
  • Are Galasoft.MvvmLight, Galasoft.MvvmLight.Extras and Galasoft.MvvmLight.Platform there in the project's "References" folder in Visual Studio? – adhie Aug 30 '18 at 16:32

1 Answers1

0

or one of its dependencies

Most likely you are not missing GalaSoft.MvvmLight, Version=5.4.1.0, but rather you missing one of its dependencies. Take a look on its dependency list. Also, it is common that GalaSoft.MvvmLight depend on a different version of a library, than version you are using in your project.

Igor Yalovoy
  • 1,715
  • 1
  • 17
  • 22