我已经使用Nuget添加了SpecFlow,并且只有一个规范(因此它是一个简单的项目)。我使用网页构建编辑器在VS online 2015中创建了一个版本。
也许它是Nuget新构建系统的问题?我不确定它是否只是一个SpecFlow的东西,并且还没有机会尝试直接进行MS单元测试。
调用执行程序时发生异常 ' executor:// mstestadapter / v1':无法加载文件或程序集 ' TechTalk.SpecFlow,Version = 1.9.0.77,Culture = neutral, 公钥= 0778194805d6db41'或其中一个依赖项。该 系统找不到指定的文件。
这里有更大的堆栈跟踪:
1. 2015-08-03T21:26:27.6325511Z Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\tasks\VSTest\1.0.16\VSTest.ps1
2. 2015-08-03T21:26:28.4231183Z ##[debug]Calling Invoke-VSTest for all test assemblies
3. 2015-08-03T21:26:28.4481177Z Working folder: C:\a\14076a40
4. 2015-08-03T21:26:28.4481177Z Executing C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe "C:\a\14076a40\SpecByExample\SpecByExample.Specs\bin\Debug\SpecByExample.Specs.dll" "C:\a\14076a40\SpecByExample\SpecByExample.Specs\bin\Debug\SpecByExample.Specs.dll.config" "C:\a\14076a40\SpecByExample\SpecByExample.Specs\obj\Debug\SpecByExample.Specs.dll" /logger:trx
5. 2015-08-03T21:26:29.4654019Z Microsoft (R) Test Execution Command Line Tool Version 14.0.23107.0
6. 2015-08-03T21:26:29.4664025Z Copyright (c) Microsoft Corporation. All rights reserved.
7. 2015-08-03T21:26:29.4664025Z Starting test execution, please wait...
8. 2015-08-03T21:26:29.7564024Z Warning: Unable to load types from the test source 'C:\a\14076a40\SpecByExample\SpecByExample.Specs\obj\Debug\SpecByExample.Specs.dll'. Some or all of the tests in this source may not be discovered. If you are running unit tests for Windows Store apps and referencing custom WinMD type then please visit http://go.microsoft.com/fwlink/?LinkId=238340 for more info. Error details: System.IO.FileNotFoundException: Could not load file or assembly 'SpecResults, Version=0.1.0.7, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
9. 2015-08-03T21:26:29.7574029Z .
10. 2015-08-03T21:26:40.6922424Z Passed TheUserVisitsTheWebsite
11. 2015-08-03T21:26:41.3214684Z ##[error]Error: An exception occurred while invoking executor 'executor://mstestadapter/v1': Could not load file or assembly 'TechTalk.SpecFlow, Version=1.9.0.77, Culture=neutral, PublicKeyToken=0778194805d6db41' or one of its dependencies. The system cannot find the file specified.
12. 2015-08-03T21:26:41.3224680Z ##[error]
13. 2015-08-03T21:26:41.4936886Z Results File: C:\a\14076a40\TestResults\buildguest_TASKAGENT-0007 2015-08-03 21_26_40.trx
14. 2015-08-03T21:26:41.4956876Z Total tests: 1. Passed: 1. Failed: 0. Skipped: 0.
15. 2015-08-03T21:26:41.4966881Z ##[error]Test Run Failed.
16. 2015-08-03T21:26:41.4966881Z Test execution time: 11.8787 Seconds
17. 2015-08-03T21:26:41.7581094Z ##[error]VSTest Test Run failed with exit code: 1
18. 2015-08-03T21:26:41.7741099Z Publishing Test Results...
2015-08-03T21:26:43.0372165Z Test results remaining: 1
更新:我禁用了SpecFlow测试并添加了最简单的AboutController测试(来自Visual Studio中的文件新项目MVC)。我仍然无法加载装配问题。 SpecByExample.Web是我解决方案中的MVC项目。
2015-08-07T16:16:56.7251975Z ## [错误]错误信息:
2015-08-07T16:16:56.7261978Z ## [错误]测试方法 SpecByExample.Web.Tests.Controllers.HomeControllerTests.AboutTest 抛出异常:2015-08-07T16:16:56.7261978Z[error] System.IO.FileNotFoundException:无法加载文件或程序集' SpecByExample.Web,Version = 1.0.0.0,Culture = neutral,
公钥=空'或其中一个依赖项。系统不能 找到指定的文件.WRN:关闭装配绑定日志 2015-08-07T16:16:56.7271982Z ## [错误]启用程序集绑定失败 记录,设置注册表值 [HKLM \ Software \ Microsoft \ Fusion!EnableLog](DWORD)为1.
2015-08-07T16:16:56.7271982Z ## [错误]注意:有一些性能 与程序集绑定失败日志记录相关的惩罚 2015-08-07T16:16:56.7281979Z ## [错误]要关闭此功能,请删除 注册表值[HKLM \ Software \ Microsoft \ Fusion!EnableLog] 2015-08-07T16:16:56.7281979Z ## [错误] 2015-08-07T16:16:56.7291971Z[错误]堆栈跟踪:2015-08-07T16:16:56.7291971Z ## [错误]在SpecByExample.Web.Tests.Controllers.HomeControllerTests.AboutTest()
2015-08-07T16:16:56.7831986Z结果文件: C:\ a \ 14076a40 \ TestResults \ buildguest_TASKAGENT-0007 2015-08-07 16_16_56.trx 2015-08-07T16:16:56.7861977Z附件:
2015-08-07T16:16:56.7861977Z ## [错误]测试运行失败。