I have a .NET Framework 4.6.1 project and need to reference a .NET 6 dll. I have no error adding the assembly except when executing the 4.6.1 client with the following error:

Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.

Thanks in advance.

1

There are 1 best solutions below

1
woodykiddy On

So based on what you said in the post, I'd assume you've manually added a .NET 6 DLL to your project. The error suggests that you might need to reference more DLLs to include all its required dependencies, e.g. .NET v6 version of System.Runtime etc.

Otherwise, try installing the .NET 6 SDK on your machine so that necessary runtime components/DLLs are available globally.

Also, something worth noting - the assembly binding redirects can potentially cause conflicts if it's not configured correctly. So check your configuration file and see if there's anything suspicious there.