【问题标题】:Got LoaderExceptions in setting specflow 1.9 in for WindowsPhone在为 WindowsPhone 设置 specflow 1.9 时遇到 LoaderExceptions
【发布时间】:2023-03-21 00:23:01
【问题描述】:

我试图跟随 https://github.com/Expensify/WindowsPhoneTestFramework/wiki/Setting-up-a-new-BDD-machine

在 WindowsPhone 上设置 Specflow。

我安装了 Specflow 1.8.1。所以我先卸载 1.8.1 并在 VS2010 上安装 Specflow 1.9 插件。 运行 Specflow 时。我仍然有以下异常。

[错误] 添加两个数字:无法加载一个或多个请求的类型。检索 LoaderExceptions 属性以获取更多信息。 System.Reflection.ReflectionTypeLoadException:无法加载一种或多种请求的类型。检索 LoaderExceptions 属性以获取更多信息。 在 System.Reflection.RuntimeModule.GetTypes(RuntimeModule 模块) 在 System.Reflection.RuntimeModule.GetTypes() 在 System.Reflection.Assembly.GetTypes() 在 TechTalk.SpecFlow.Bindings.Discovery.RuntimeBindingRegistryBuilder.BuildBindingsFromAssembly(程序集程序集) 在 TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.Initialize(Assembly[] bindingAssemblies) 在 TechTalk.SpecFlow.TestRunner.InitializeTestRunner(Assembly[] bindingAssemblies) 在 TechTalk.SpecFlow.Infrastructure.TestRunnerFactory.Create(Assembly testAssembly) 在 TechTalk.SpecFlow.TestRunnerManager.CreateTestRunner(TestRunnerKey 键) 在 TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(TestRunnerKey 键) 在 TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(组装 testAssembly,布尔异步) 在 TechTalk.SpecFlow.TestRunnerManager.GetTestRunner() 在 C:\source\PhoneApp1\ClassLibrary1\SpecFlowFeature1.feature.cs:line 0 中的 ClassLibrary1.SpecFlowFeature1Feature.FeatureSetup() 在 c:\TeamCity\buildAgent\work\1ace6ed01d0a43bb\TechTalk.SpecRun.Framework\TaskExecutors\StaticOrInstanceMethodExecutor.cs:line 40 中的 TechTalk.SpecRun.Framework.TaskExecutors.StaticOrInstanceMethodExecutor.ExecuteInternal(TestThreadExecutionContext testThreadExecutionContext) 在 TechTalk.SpecRun.Framework.TaskExecutors.StaticOrInstanceMethodExecutor.Execute(TestThreadExecutionContext testThreadExecutionContext) 在 c:\TeamCity\buildAgent\work\1ace6ed01d0a43bb\TechTalk.SpecRun.Framework\TaskExecutors\StaticOrInstanceMethodExecutor.cs:line 21 在 TechTalk.SpecRun.Framework.TaskExecutors.ChainedTaskExecutor.Execute(TestThreadExecutionContext testThreadExecutionContext) 在 c:\TeamCity\buildAgent\work\1ace6ed01d0a43bb\TechTalk.SpecRun.Framework\TaskExecutors\ChainedTaskExecutor.cs:line 20 在 c:\TeamCity\buildAgent\work\1ace6ed01d0a43bb\TechTalk.SpecRun.Framework\TestThreadExecutor.cs:line 220 中的 TechTalk.SpecRun.Framework.TestThreadExecutor.ExecuteTestNodeTask(TestNode testNode, ITaskExecutor task, TraceEventType eventType)

内部异常是 LoaderExceptions 包括 {“无法加载文件或程序集 'TechTalk.SpecFlow, Version=1.8.1.0, Culture=neutral, PublicKeyToken=0778194805d6db41' 或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。(来自 HRESULT 的异常: 0x80131040)":"TechTalk.SpecFlow,版本=1.8.1.0,文化=中性,PublicKeyToken=0778194805d6db41"}

我不知道为什么它仍然加载 1.8.1 SpecFlow 程序集。我已经卸载了 SpecFlow 1.8.1。还有什么地方需要手动改吗?

谢谢!

【问题讨论】:

  • 当我用 1.8 替换 1.9 specflow 库时。但它显示现在找不到 1.9 库。仍然被这个问题阻止。

标签: windows-phone-7 nuget specflow wp7test


【解决方案1】:

WP7Test 包似乎依赖于 SpecFlow 1.8.1。据我在 github 项目上看到的,它还没有更新到 SpecFlow 1.9。

SpecRun.SpecFlow 1.1 需要 SpecFlow 1.9。 (如果您安装过时的 SpecRun (1.0) 包,将使用此功能。)

我认为最好的办法是在 github 上 fork WP7Test 项目并将其更新为使用 SpecFlow 1.9。完成此操作后,它也应该可以与最新的 SpecRun 一起正常工作。

(另一种方法是使用 SpecRun.SpecFlow 1.0 包,该包可与 SpecFlow 1.8.1 一起使用,并且还受 SpecFlow 1.9 IDE 集成的支持。)

【讨论】:

  • 非常有帮助。非常感谢:)
猜你喜欢
  • 1970-01-01
  • 2021-06-11
  • 2011-04-10
  • 2013-05-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多