Skip to content

[BUG]: Dotnet test: No test result files were found #21052

Open
@yepeekai

Description

@yepeekai

New issue checklist

Task name

DotNetCoreCLI@2

Task version

2.256.3

Issue Description

I run the task using the following configuration:

  - task: DotNetCoreCLI@2
    displayName: 'dotnet test'
    inputs:
      command: test
      arguments: '--configuration $(buildConfiguration) --no-build'
      projects: |
        **/*.UT.csproj
    continueOnError: true

I use the no-build parameter because projects are built before in the pipeline.

In .net 8, the log results were correctly published. Now with .net 9 (9.0.5 at this moment) the result are not found. I use the vmimage ubuntu-latest. It appears to run fine, I can see the results in the log but no trx files are generated.

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

ubuntu-latest

Relevant log output

2025-05-23T17:42:33.2185713Z ##[section]Starting: dotnet test
2025-05-23T17:42:33.2192390Z ==============================================================================
2025-05-23T17:42:33.2192514Z Task         : .NET Core
2025-05-23T17:42:33.2192575Z Description  : Build, test, package, or publish a dotnet application, or run a custom dotnet command
2025-05-23T17:42:33.2192682Z Version      : 2.256.3
2025-05-23T17:42:33.2192750Z Author       : Microsoft Corporation
2025-05-23T17:42:33.2192817Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/dotnet-core-cli
2025-05-23T17:42:33.2192924Z ==============================================================================
2025-05-23T17:42:33.6486038Z Info: .NET Core SDK/runtime 2.2 and 3.0 are now End of Life(EOL) and have been removed from all hosted agents. If you're using these SDK/runtimes on hosted agents, kindly upgrade to newer versions which are not EOL, or else use UseDotNet task to install the required version.
2025-05-23T17:42:34.3164950Z [command]/opt/hostedtoolcache/dotnet/dotnet test /home/vsts/work/1/s/SomeProject.Domain.UT/SomeProject.Domain.UT.csproj --logger trx --results-directory /home/vsts/work/_temp --configuration Release --no-build
2025-05-23T17:42:34.9273204Z   Run tests: '/home/vsts/work/1/s/SomeProject.Domain.UT/bin/Release/net9.0/SomeProject.Domain.UT.dll' [net9.0|x64]
2025-05-23T17:42:36.4695346Z   Passed! - Failed: 0, Passed: 12, Skipped: 0, Total: 12, Duration: 1s 260ms - SomeProject.Domain.UT.dll (net9.0|x64)
2025-05-23T17:42:36.6241878Z   Tests succeeded: '/home/vsts/work/1/s/SomeProject.Domain.UT/bin/Release/net9.0/SomeProject.Domain.UT.dll' [net9.0|x64]
2025-05-23T17:42:36.6644672Z 
2025-05-23T17:42:36.6659105Z [command]/opt/hostedtoolcache/dotnet/dotnet test /home/vsts/work/1/s/SomeProject.Web.UT/SomeProject.Web.UT.csproj --logger trx --results-directory /home/vsts/work/_temp --configuration Release --no-build
2025-05-23T17:42:37.2984768Z   Run tests: '/home/vsts/work/1/s/SomeProject.Web.UT/bin/Release/net9.0/SomeProject.Web.UT.dll' [net9.0|x64]
2025-05-23T17:42:40.7669199Z   Passed! - Failed: 0, Passed: 5, Skipped: 0, Total: 5, Duration: 3s 181ms - SomeProject.Web.UT.dll (net9.0|x64)
2025-05-23T17:42:40.9271305Z   Tests succeeded: '/home/vsts/work/1/s/SomeProject.Web.UT/bin/Release/net9.0/SomeProject.Web.UT.dll' [net9.0|x64]
2025-05-23T17:42:40.9665637Z 
2025-05-23T17:42:40.9682950Z [command]/opt/hostedtoolcache/dotnet/dotnet test /home/vsts/work/1/s/Framework/SomeFramework.Entity.UT/SomeFramework.Entity.UT.csproj --logger trx --results-directory /home/vsts/work/_temp --configuration Release --no-build
2025-05-23T17:42:41.6401798Z   Run tests: '/home/vsts/work/1/s/Framework/SomeFramework.Entity.UT/bin/Release/net9.0/SomeFramework.Entity.UT.dll' [net9.0|x64]
2025-05-23T17:42:43.8938951Z   Passed! - Failed: 0, Passed: 36, Skipped: 0, Total: 36, Duration: 1s 979ms - SomeFramework.Entity.UT.dll (net9.0|x64)
2025-05-23T17:42:44.0386226Z   Tests succeeded: '/home/vsts/work/1/s/Framework/SomeFramework.Entity.UT/bin/Release/net9.0/SomeFramework.Entity.UT.dll' [net9.0|x64]
2025-05-23T17:42:44.0806650Z 
2025-05-23T17:42:44.0832851Z [command]/opt/hostedtoolcache/dotnet/dotnet test /home/vsts/work/1/s/Framework/SomeFramework.UT/SomeFramework.UT.csproj --logger trx --results-directory /home/vsts/work/_temp --configuration Release --no-build
2025-05-23T17:42:44.7210065Z   Run tests: '/home/vsts/work/1/s/Framework/SomeFramework.UT/bin/Release/net9.0/SomeFramework.UT.dll' [net9.0|x64]
2025-05-23T17:42:46.3799450Z   Passed! - Failed: 0, Passed: 165, Skipped: 0, Total: 165, Duration: 1s 370ms - SomeFramework.UT.dll (net9.0|x64)
2025-05-23T17:42:46.5281012Z   Tests succeeded: '/home/vsts/work/1/s/Framework/SomeFramework.UT/bin/Release/net9.0/SomeFramework.UT.dll' [net9.0|x64]
2025-05-23T17:42:46.6082515Z 
2025-05-23T17:42:46.6101044Z [command]/opt/hostedtoolcache/dotnet/dotnet test /home/vsts/work/1/s/Framework/SomeFramework.Web.UT/SomeFramework.Web.UT.csproj --logger trx --results-directory /home/vsts/work/_temp --configuration Release --no-build
2025-05-23T17:42:47.2454327Z   Run tests: '/home/vsts/work/1/s/Framework/SomeFramework.Web.UT/bin/Release/net9.0/SomeFramework.Web.UT.dll' [net9.0|x64]
2025-05-23T17:42:48.3347432Z   Passed! - Failed: 0, Passed: 39, Skipped: 0, Total: 39, Duration: 810ms - SomeFramework.Web.UT.dll (net9.0|x64)
2025-05-23T17:42:48.4802891Z   Tests succeeded: '/home/vsts/work/1/s/Framework/SomeFramework.Web.UT/bin/Release/net9.0/SomeFramework.Web.UT.dll' [net9.0|x64]
2025-05-23T17:42:48.5584359Z 
2025-05-23T17:42:48.6386978Z ##[warning]No test result files were found.
2025-05-23T17:42:48.6388544Z Info: Azure Pipelines hosted agents have been updated and now contain .Net 5.x SDK/Runtime along with the older .Net Core version which are currently lts. Unless you have locked down a SDK version for your project(s), 5.x SDK might be picked up which might have breaking behavior as compared to previous versions. You can learn more about the breaking changes here: https://docs.microsoft.com/en-us/dotnet/core/tools/ and https://docs.microsoft.com/en-us/dotnet/core/compatibility/ . To learn about more such changes and troubleshoot, refer here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting
2025-05-23T17:42:48.6484096Z ##[section]Finishing: dotnet test

Full task logs with system.debug enabled

 [REPLACE THIS WITH YOUR INFORMATION] 

Repro steps

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions