I’m working on VS 2010 and myProject’s type is a C# windows forms application. When I add a new project to my solution and adding references for nunit and myProject I got the “System.BadImageFormatException: Could not load file or assembly” error. However if I don’t use a separated project for my test classes, it works. Is it because myProject’s type is not class library?
Note: I’m not testing GUI. Just some classes.
No, there’s nothing that hinders you to add an NUnit reference to a WinForms application (after all, it is not different from a class lib from a pure technical standpoint).
The reason for the
BadImageFormatExceptionmust come from a different source. In many cases it’s a 32/64bit mismatch, or there might be some conflicting call conventions in place or sth. similar which goes in that direction. In any case, it has to be something compiler-related…HTH – Thomas