I have a solution containing my main project and a test project using NUnit. Everything compiles, but when I run NUnit, I get an exception below after loading the tests, and the tests fail. I added the main project as a reference, and I have $ (ProjectDir) bin / Debug / $ (TargetName) $ (TargetExt) in the arguments for NUnit in the external tool settings, with an empty source directory.
MyMainProjectTests.Database.TestAddDelete: System.BadImageFormatException : Could not load file or assembly 'MyMainProject, Version=1.1.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format. TearDown : System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.
After cleaning for hours, the only thing I found was an error in VS2005, which mentions the / bin and / obj directories, but the answer provided did not help.
Any solutions?
source share