我能够通过CodeRush通过VS2010运行我的单元测试,但是当我尝试使用Icarus Test Runner运行测试时,我得到了这个错误。
An exception was thrown while exploring tests.
Location: C:XXXXXX.Server.TestsbinReleaseXXX.Server.Tests.DLL
Reference: XXXServer.Tests, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null Details: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at Gallio.Common.Reflection.Impl.NativeAssemblyWrapper.GetTypes()
at Gallio.Framework.Pattern.TestAssemblyPatternAttribute.PopulateChildrenImmediately(IPatternScope assemblyScope, IAssemblyInfo assembly)
at Gallio.Framework.Pattern.TestAssemblyPatternAttribute.Consume(IPatternScope containingScope, ICodeElementInfo codeElement, Boolean skipChildren)
at Gallio.Framework.Pattern.DefaultPatternEvaluator.Consume(IPatternScope containingScope, ICodeElementInfo codeElement, Boolean skipChildren, IPattern defaultPrimaryPattern)
我已经确保Copy Local设置为True用于项目引用
测试在64位机器上运行,测试项目平台目标设置为"任意CPU",而被测试项目设置为"x86"。因此,当试图以同样的方式加载正在测试的项目时,机器以64加载测试,这导致了错误。