2011-11-18 69 views
1

我能够通过CodeRush通过VS2010运行我的单元测试,但是当我尝试使用Icarus Test Runner运行测试时,出现此错误。Gallio:探索测试时抛出一个异常:System.Reflection.ReflectionTypeLoadException

An exception was thrown while exploring tests. 
Location: C:\XXX\XXX.Server.Tests\bin\Release\XXX.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) 

我已经确定复制本地设置为True以便项目引用。

回答

1

在64位计算机上运行测试,测试项目Platform target设置为“Any CPU”,而被测试的项目设置为“x86”。因此,该机器将加载测试的结果设为64,这导致在尝试以相同方式加载正在测试的项目时导致错误。

+0

我有完全相同的问题,你是如何解决它的?无论如何告诉加利奥加载在32位测试? – MaYaN