2011-11-18 33 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