gpt4 book ai didi

nunit - 找不到具有 AssemblyQualifiedName、URI 或 FriendlyName 'nunit' 的测试记录器

转载 作者:行者123 更新时间:2023-12-05 01:58:29 25 4
gpt4 key购买 nike

我正在尝试创建一个 nunit 测试结果 xml 文件并将其附加到我在开发操作中构建的测试运行。我在我的测试项目中安装了 NUnit3TestAdapter.3.13.0 包,并在 VS 测试任务的控制台选项中引用了它(测试任务是版本 2)。

packages.config: enter image description here

enter image description here

我在“其他控制台选项”字段中尝试了各种组合,包括“/TestAdapterPath:”。或者根本不说明测试适配器路径。我还尝试将测试适配器部分作为“$(Build.SourcesDirectory)\packages\NUnit3TestAdapter.3.13.0\build\net35”移到“自定义测试适配器的路径”字段中。但是,每次测试任务都返回错误:

Microsoft (R) Test Execution Command Line Tool Version 16.9.1
Copyright (c) Microsoft Corporation. All rights reserved.
vstest.console.exe "C:\VSTSBuild\agentB\_work\2\s\SomeService.Tests\bin\SomeService.Tests.dll"
/Settings:"C:\VSTSBuild\agentB\_work\_temp\41oiukcwga4.tmp.runsettings"
/EnableCodeCoverage
/Logger:"trx"
/TestAdapterPath:"C:\VSTSBuild\agentB\_work\2\s"
/logger:nunit /TestAdapterPath:C:\VSTSBuild\agentB\_work\2\s\packages\NUnit3TestAdapter.3.13.0\build\net35
Starting test execution, please wait...
##[error]Could not find a test logger with AssemblyQualifiedName, URI or FriendlyName 'nunit'.

最佳答案

我通过添加对此 NuGet 包的引用解决了同样的错误:

NunitXml.TestLogger

它的描述是:当使用“dotnet test”或“dotnet vstest”运行测试时,NUnit v3 兼容 xml 报告的 Xml 记录器。

关于nunit - 找不到具有 AssemblyQualifiedName、URI 或 FriendlyName 'nunit' 的测试记录器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68542280/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com