【发布时间】:2015-08-06 20:02:07
【问题描述】:
我使用 Nuget 添加了 SpecFlow,并且只有一个规范(因此它是一个简单的项目)。我使用 Web 构建编辑器在 VS Online 2015 中创建了一个构建。
也许是 Nuget 新的构建系统问题?我不确定这是否只是 SpecFlow 的事情,还没有机会尝试直接的 MS 单元测试。
调用执行器时发生异常 'executor://mstestadapter/v1': 无法加载文件或程序集 'TechTalk.SpecFlow,版本=1.9.0.77,文化=中性, PublicKeyToken=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[错误]System.IO.FileNotFoundException:无法加载文件或程序集“SpecByExample.Web,版本=1.0.0.0,文化=中性,
PublicKeyToken=null' 或其依赖项之一。系统无法 找到指定的文件。警告:程序集绑定日志记录已关闭。
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 ##[错误]测试运行失败。
【问题讨论】:
-
你解决了这个问题吗?
-
我没有,它从我的雷达上消失了,所以我有一段时间没有尝试过。
标签: msbuild tfsbuild azure-devops