我有一个解决方案,包含我的主要项目和使用NUnit的测试项目。一切都编译成功了,但是当我运行NUnit时,在测试加载后,我得到了下面的异常,导致测试失败。我已经将主项目添加为引用,并且在外部工具设置中,对于NUnit参数,我有$(ProjectDir)bin/Debug/$(TargetName)$(TargetExt),并且初始目录为空。
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.
----> System.BadImageFormatException : Could not load file or assembly
'ChickenPing, 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.
在搜寻了数小时后,我唯一发现的是VS2005中提到了/bin和/obj目录的一个bug,但所提供的答案并没有帮助。
有什么解决方案吗?