在构建管道任务中找不到与模式匹配的测试程序集:**\*.Test.dll

No test assemblies found matching the pattern: **\*.Test.dll in build pipeline task

我查看了其他答案,它们似乎对我不起作用。 我的构建工作正常,我可以在源所在的代理的 _work/2/s 文件夹(深几个文件夹)下找到 *.Test.dll 文件。但是 VSTest 任务坚持认为找不到它们。 **/*.Test.dll 应该找到它们,这是一个递归搜索,但它没有。

使用最新的本地 Azure DevOps 服务器 2019。

知道为什么使用 **/*.Test.dll 失败了吗?

这表明至少有 4 个 dll(8 个是由于 \bin\ 和 \obj)

您应该使用| 以多行定义测试文件路径。 testAssemblyVer2 字段应如下所示:

testAssemblyVer2: |
  **\*.Test.dll
  !**\*TestAdapter.dll
  !**\obj\** 

参见 Visual Studio Test task 的文档。