Visual Studio: run tests from Test Results view (trx file)

137 views Asked by At

We have a .Net solution developed by a team. Unit tests are run on a build server, which generates a trx file with results. I can open this file in my local Visual Studio, I can see the results, but I can't run the tests - the options to run, debug or open test are greyed out.

How can I run the tests from this view? Do I have to connect my tests somehow to the results in the trx file?

1

There are 1 answers

0
bryanbcook On

A TRX file is a Test Results File that is an output produced by a test runner when it executes your tests. The file is intended to be portable so that you can download the test run from another machine or build agent to view the results within Visual Studio or other viewer.

Although it contains the meta-data about the tests, it does not contain the source material that was used to produced the output.

To re-run the tests in Visual Studio, you should open the .sln file that contains the original tests and execute them locally.

Alternatively, if you don't have access to the source files but you do have access to the compiled outputs (dll). You can run them from a command-line:

dotnet test myproject.tests.dll --logger trx