Search code examples
c#.net.net-assembly

FileLoadException: The located assembly's manifest definition does not match the assembly


I downloaded a NuGet package for a project (Episerver). I'm trying to replace one specific dll with one of my one of my own implementation, with same name, same namespace, etc... by deleting the dll downloaded from Nuget and loading mine as a reference.

Everything compiles fine, but when trying to execute it, I get the following error:

Could not load file or assembly 'Mediachase.Commerce.Website, Version=7.10.1.169, Culture=neutral, PublicKeyToken=6e58b501b34abce3' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Does anyone have a clue on how I can solve this issue? Because I've been smashing my head quite some time against that problem, checked endless forums, and couldn't find any solution that works for me.

Thanks!


Solution

  • That won't work - you have to rebuild assemblies referencing the one you've replaced as well. You can try to use reflector to make c# code from those assemblies referencing your dll and rebuild those assemblies.