I looked at a couple of problems with nunit and visual studio described in stackoverflow, but cannot find the thread where my case fits.
I use NUnit to check the code that I wrote, I upload the * .csproj file of my test project to the NUnit GUI tool.
I solved the problem, I think, but still have not received a solution. What am I doing:
I refer to 2 other projects as dll projects. This means that I got 3 projects: TestProject (DLL), SettingsManager (DLL), DatabaseInterface (DLL). They are all in one solution. The DatabaseInterface project contains its own api calls for another, C ++ x86, DLL, but does not reference the explicit link to this DLL through the using statement.
One of them is the Settings manager, which stores some configuration data, such as paths, etc., but anyway. Both Testproject and DatabaseInterface allude to SettingsManager.
All 3 projects are built in "Debug" and "AnyCPU". Summarizing and using only the ConfigurationManager in my TestProject works fine, but when I add the DatabaseInterface, I get a BadImageFormatException that says it is trying to load a file with the wrong format.
To make it more visible, this works:
using myNamespace.Settings;
NUnit output:
This does not work:
using myNamespace.Settings;
Second attempt containing
using myNamespace.DbInterface;
throws myNamespace.myTestProject.TestProject (TestFixtureSetUp): SetUp: System.BadImageFormatException: Die Datei oder Assembly "DatabaseInterface, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null" or the link was not found. He tried to download the file in the wrong format.
even if all 3 projects are built using Debug and AnyCPU.
I use the standard * .config file, for example, one of the NUnit Testproject. Perhaps some are wrong about this.
Has anyone encountered the same error trying to load code from another dll? Could it be a problem that both projects (Test and Database) reference the SettingsManager DLL? Did I do something serious?
I double-checked the build configuration in all three projects, but could not find any settings that might be incorrect, and explains the BadImageFormatException exception.