Azure Devops>运行测试计划:Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException

时间:2019-11-13 22:39:43

标签: azure-devops automated-tests

将“运行测试”任务添加到管道中。测试通过,但日志显示以下错误:

  

Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException:无法找到** \ obj \ release \ netcoreapp2.2 \ myProject.deps.json。确保测试项目具有软件包``Microsoft.NET.Test.Sdk''的详细参考。

enter image description here 该项目确实具有Test.Sdk的nuget包。 我在这里想念什么?谢谢。

1 个答案:

答案 0 :(得分:0)

错误说文件夹“ \ obj \ release ..”中缺少myProject.deps.json。此文件夹包含dotnet build的输出文件,该文件没有文件myProject.deps.json。您可能需要将vstest search folder指向dotnet publish任务的已发布文件夹。

您可以为 dotnet发布任务添加输出自变量(-o $(build.artifactstagingdirectory)),以专门发布到文件夹。

对于下面的示例,输出文件将发布到$(build.artifactstagingdirectory),其中包含文件myProject.deps.json。

enter image description here

然后在您的vstest任务中,可以将测试搜索文件夹指定为$(build.artifactstagingdirectory) enter image description here