Failed to load assembly in NUnit

It seems like this should be a common problem that I expected to find the answer through a quick Google search, but, alas, I can not find the answer.

I am writing Unit Test using NUnit in C # for a method that relies on a third-party library, Newtonsoft.Json, to be specific.

When I try to call this method from my Unit Test, I get everything in normal

Failed to load file or assembly "Newtonsoft.Json, Version = 4.5.0.0, Culture = neutral, PublicKeyToken = 30ad4fe6b2a6aeed" or one of its dependencies. The specific assembly manifest definition does not match the assembly reference.

Both Unit Test and the application use the same newtonsoft library, and dll - for copying in both projects.

It seems like I'm missing something beyond the obvious, but I can't handle this problem.

+8
c # unit-testing nunit
source share
1 answer

"The installed assembly manifest definition does not match the assembly reference" Indicates that it can find the DLL, but there is a version mismatch between the assembly and what is in the manifest of your project. Can you verify in Windows Explorer that the version of the DLL is indeed 4.5.0.0?

I would also be interested to know if there is more than one version of this assembly in your GAC - perhaps NUnit uses a different version by default.

+2
source share

All Articles