Forum Discussion
rfancher
Aug 15, 2023Copper Contributor
Running xUnit tests in ADO Release Pipeline
Hello, We have some xUnit tests that we are trying to run in an ADO Release Pipeline. We have associated these xUnit tests with Test Cases, and the goal is to run these test cases from the Test ...
Kidd_Ip
Aug 28, 2025MVP
Try the workarounds at the following:
- Ensure xUnit Adapter Is Present
Make sure your test project includes:
dotnet add package xunit.runner.visualstudio
This ensures the adapter is bundled with your test DLL.
- Explicitly Set TestAdapterPath
In the Visual Studio Test task, add this under Execution Options > Other console options:
/TestAdapterPath:"$(System.DefaultWorkingDirectory)\_yourArtifactPath\bin"
This tells the test runner where to find the xUnit adapter DLL.
- Use dotnet test Instead of Test Plan Execution
If possible, switch your Release pipeline to use a command-line task that runs:
dotnet test --logger:trx
This bypasses the Test Plan integration and uses the same reliable method as your CI pipeline.
- Use YAML Pipeline Instead of Classic Release
Many teams are migrating to multi-stage YAML pipelines which unify build and release. This avoids the quirks of the classic Release pipeline and gives you full control over test execution.