在为WindowsPhone设置specflow 1.9时获得了LoaderExceptions

时间:2012-08-15 06:44:21

标签: windows-phone-7 nuget specflow wp7test

我试着跟着 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()      at TechTalk.SpecFlow.Bindings.Discovery.RuntimeBindingRegistryBuilder.BuildBindingsFromAssembly(Assembly assembly)      在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 key)      在TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(TestRunnerKey key)      在TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(Assembly testAssembly,Boolean async)      在TechTalk.SpecFlow.TestRunnerManager.GetTestRunner()      在C:\ source \ PhoneApp1 \ ClassLibrary1 \ SpecFlowFeature1.feature.cs中的ClassLibrary1.SpecFlowFeature1Feature.FeatureSetup():第0行      at TechTalk.SpecRun.Framework.TaskExecutors.StaticOrInstanceMethodExecutor.ExecuteInternal(TestThreadExecutionContext testThreadExecutionContext)in c:\ TeamCity \ buildAgent \ work \ 1ace6ed01d0a43bb \ TechTalk.SpecRun.Framework \ TaskExecutors \ StaticOrInstanceMethodExecutor.cs:line 40      at TechTalk.SpecRun.Framework.TaskExecutors.StaticOrInstanceMethodExecutor.Execute(TestThreadExecutionContext testThreadExecutionContext)在c:\ TeamCity \ buildAgent \ work \ 1ace6ed01d0a43bb \ TechTalk.SpecRun.Framework \ TaskExecutors \ StaticOrInstanceMethodExecutor.cs:第21行      at TechTalk.SpecRun.Framework.TaskExecutors.ChainedTaskExecutor.Execute(TestThreadExecutionContext testThreadExecutionContext)在c:\ TeamCity \ buildAgent \ work \ 1ace6ed01d0a43bb \ TechTalk.SpecRun.Framework \ TaskExecutors \ ChainedTaskExecutor.cs:第20行      at TechTalk.SpecRun.Framework.TestThreadExecutor.ExecuteTestNodeTask(TestNode testNode,ITaskExecutor task,TraceEventType eventType)在c:\ TeamCity \ buildAgent \ work \ 1ace6ed01d0a43bb \ TechTalk.SpecRun.Framework \ TestThreadExecutor.cs:第220行

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

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

谢谢!

1 个答案:

答案 0 :(得分:1)

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

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

我认为最好的方法是在github上分叉WP7Test项目并更新它以使用SpecFlow 1.9。执行此操作后,它也可以使用最新的SpecRun。

(另一种方法是使用SpecFun.SpecFlow 1.0软件包,它与SpecFlow 1.8.1一起使用,并且也受到SpecFlow 1.9 IDE集成的支持。)