在我们将项目升级到.NET 4.0后,我一直在尝试迁移到FitSharp,但我现在遇到了这个错误:
System.TypeLoadException: Could not load type 'fit.PrimitiveFixture' from assembly 'fit, Version=2.2.4498.25494, Culture=neutral, PublicKeyToken=null'.
at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)
at System.Reflection.RuntimeAssembly.GetExportedTypes()
at fitSharp.Machine.Engine.CurrentDomain.LoadAssembly(String assemblyPath)
at fitSharp.Machine.Engine.ApplicationUnderTest.Assemblies.AddAssembly(String assemblyName)
at fitSharp.Machine.Engine.ApplicationUnderTest.AddAssemblies(IEnumerable`1 assemblyNames)
at fitnesse.fitserver.FitServer.ParseCommandLineArguments(IEnumerable`1 args)
at fitnesse.fitserver.FitServer.Run(IList`1 CommandLineArguments)
at fitnesse.fitserver.FitServer.Run(IList`1 commandLineArguments, Memory memory, ProgressReporter reporter)
at fitSharp.Machine.Application.Shell.Run()
at fitSharp.Machine.Application.Shell.Execute()
at fitSharp.Machine.Application.Shell.Run(IList`1 commandLineArguments)我使用and Standalone.jar作为服务器,如果这样做有什么不同的话,并使用ofc。在fitnesse的根目录中定义了FitSharp运行器,我们将fitsharp放在fitnesse内的一个子目录中,因此路径是相对的。
!path ..\..\..\Output\Runtime\*.dll
!define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer,fitSharp\fit.dll %p}
!define TEST_RUNNER {fitsharp\Runner.exe}显然,fit.PrimitiveFixture并不存在,一般来说,我可以看到,与FitNesse本身捆绑在一起的fit.dll相比,它已经缩小了不少。
我还不能确定它为什么试图加载它,这源于...我已经查看了是否有任何突破性的更改可以暗示任何东西,但这并没有给我一个真正的想法,显然我也更改了所有的引用以适应,以便它指向新的库,而不是成功地捆绑和编译的库(虽然还必须添加fitsharp.dll )……
我真的不能开始调试,因为在那之前很久它就失败了。
人们应该认为其他人也经历过同样的事情,但情况似乎并非如此,至少我在谷歌上的尝试没有产生太多有用的结果。
因此,这里希望有人遇到了同样的问题,但他们自己解决了它,而不是在网上分享信息。可能对FitNesse和FitSharp有更深入了解的人?
发布于 2012-12-22 13:55:32
可能是路径中的某个程序集有问题:......\Output\Runtime*.dll尝试仅列出测试所需的单个程序集,看看这是否有助于缩小导致问题的程序集的范围。
https://stackoverflow.com/questions/13949568
复制相似问题