Msbuild Visual Studio Online测试运行程序可以';加载SpecFlow动态链接库

Msbuild Visual Studio Online测试运行程序可以';加载SpecFlow动态链接库,msbuild,tfsbuild,azure-devops,Msbuild,Tfsbuild,Azure Devops,我使用Nuget添加了SpecFlow,并且只有一个spec(因此它是一个简单的项目)。我已经使用web build editor在VS online 2015中创建了一个内置版本 也许这是Nuget新构建系统的问题?我不确定它是否只是一个SpecFlow的东西,还没有机会尝试直接的MS单元测试 调用执行器时发生异常 'executor://mstestadapter/v1“:无法加载文件或程序集 'TechTalk.SpecFlow,版本=1.9.0.77,区域性=中性, PublicKeyT

我使用Nuget添加了SpecFlow,并且只有一个spec(因此它是一个简单的项目)。我已经使用web build editor在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文件)。我仍然遇到“无法加载程序集”问题。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\u TASKAGENT-0007 2015-08-07 16_16_56.trx 2015-08-07T16:16:56.7861977Z附件:
2015-08-07T16:16:56.7861977Z###[错误]测试运行失败

以下是我的构建定义的屏幕截图:
在运行单元测试步骤中。单击“前进”并提供“包”文件夹的路径。(如果您使用的是nuget,它将在那里下载所有依赖项)尝试一下,让我知道它是如何运行的

我放入$(Build.SourcesDirectory)\SpecByExample.Web\packages并获取路径“C:\a\14076a40\SpecByExample\SpecByExample.Web\packages”在“TestAdapterPath”中指定无效$(Build.SourcesDirectory)\packages获取的msbuild退出代码为1$(Build.SourcesDirectory)是源的宿主。所以在它应该是解决方案目录和包文件夹之后。你解决了这个问题吗?我没有,它从我的雷达上掉下来了,所以我有一段时间没有尝试过。