gpt4 book ai didi

.net - 在 azure 代理中运行 nunit 测试时找不到 testhost.deps.json 文件

转载 作者:行者123 更新时间:2023-12-02 22:49:45 26 4
gpt4 key购买 nike

我正在 azure devops 代理上运行一些 API 测试并收到此警告错误消息

  2021-05-21T13:42:29.0650201Z ##[error]DiscoveryMessage : Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Testhost process exited with error: Cannot use file stream for [C:\a\r1\a\_Automation-Build\drop\TestAutomation.UI.PageObject\bin\Debug\netcoreapp3.1\testhost.deps.json]: No such file or directory
2021-05-21T13:42:29.0661479Z ##[debug]Processed: ##vso[task.logissue type=error;]DiscoveryMessage : Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Testhost process exited with error: Cannot use file stream for [C:\a\r1\a\_Automation-Build\drop\TestAutomation.UI.PageObject\bin\Debug\netcoreapp3.1\testhost.deps.json]: No such file or directory
2021-05-21T13:42:29.0663114Z A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\Program Files\dotnet'.
2021-05-21T13:42:29.0663661Z Failed to run as a self-contained app.
2021-05-21T13:42:29.0664305Z - The application was run as a self-contained app because 'C:\a\r1\a\_Automation-Build\drop\TestAutomation.UI.PageObject\bin\Debug\netcoreapp3.1\testhost.runtimeconfig.json' was not found.
2021-05-21T13:42:29.0665393Z - If this should be a framework-dependent app, add the 'C:\a\r1\a\_Automation-Build\drop\TestAutomation.UI.PageObject\bin\Debug\netcoreapp3.1\testhost.runtimeconfig.json' file and specify the appropriate framework.
2021-05-21T13:42:29.0666319Z . Please check the diagnostic logs for more information.
2021-05-21T13:42:29.0667169Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.ThrowOnTestHostExited(Boolean testHostExited)
2021-05-21T13:42:29.0668081Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, String runSettings)
2021-05-21T13:42:29.0668810Z at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler)

我也浏览过那篇文章 https://www.gitmemory.com/issue/microsoft/vstest/2218/540508574我不确定如何使用 测试计划 选项来应用测试文件选择,而不是测试程序集 enter image description here enter image description here

最佳答案

A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\Program Files\dotnet'.

根据错误信息,您可以引用这个Github ticket .

以下是您可以尝试的方法:

  1. 更改 VSTest 任务中的测试文件路径(从 **\*test*.dll**\*test.dll)。

  2. 删除从一个测试程序集到另一个测试程序集的引用

  3. 将 Microsoft.NET.Test.SDK 更新至 16.6.1

关于.net - 在 azure 代理中运行 nunit 测试时找不到 testhost.deps.json 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67672553/

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