1
votes

"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>
1
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
@LupuSilviu yes - from VS, and package was installed from Nuget Package Manager - Doove
Are Galasoft.MvvmLight, Galasoft.MvvmLight.Extras and Galasoft.MvvmLight.Platform there in the project's "References" folder in Visual Studio? - adhie

1 Answers

0
votes

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.