.TRX

TRX File

Visual Studio Test Results File
Ask a question
QUICK ANSWER

A TRX file is an XML report generated by Microsoft Visual Studio or the .NET test runner (dotnet test --logger trx). It records which unit tests passed, failed, or were skipped, with timings and stack traces. Open it in Visual Studio, VS Code, or any text editor. Azure DevOps reads TRX files natively in pipeline runs.

Developer: Microsoft Category: Developer Files MIME: application/xml
OPENS ON Windows macOS Linux Web
Related: .DO · .MD · .HEX · .XSD

On this page

19k+ extensions indexed
Last reviewed Jul 7, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the TRX file format?

A .trx file is an XML-based test results file generated by the Microsoft Visual Studio test infrastructure. The format was introduced with Visual Studio .NET 2003 and the MSTest framework, and it remains the default output format for both mstest.exe and the cross-platform dotnet test runner.

The file is a plain UTF-8 XML document whose root element is <TestRun> within a Microsoft-specific XML namespace. Inside, it records <TestSettings> (run configuration), <TestDefinitions> (test method names and assemblies), <Results> with one <UnitTestResult> per test case (outcome, duration, timestamps, error messages, stack traces), and a <ResultSummary> with aggregate Passed/Failed/Inconclusive counts. The schema is defined in vstst.xsd, which ships with Visual Studio in the Common7/IDE/ directory.

.trx files are not created automatically - they require explicit logger configuration. To generate one, pass --logger trx to dotnet test, or supply the equivalent flag to mstest.exe. Azure DevOps and TFS parse .trx files natively through the Publish Test Results task, rendering pass/fail reports in the pipeline UI.

Because .trx is an XML format, any text editor can open it. Visual Studio Code with the C# Dev Kit provides richer visualization. The format is Microsoft-centric; cross-platform CI systems such as GitHub Actions or Jenkins typically prefer JUnit XML test reports. Since Visual Studio 2022 and the .NET SDK, .trx generation is also supported on Linux and macOS via dotnet test.

Security & safety

RISK: LOW

TRX files are plain UTF-8 XML - they contain test results, not executable code. Opening them in Visual Studio, VS Code, or a text editor is completely safe. Do not use third-party 'TRX viewer' downloads of unknown origin; they are unnecessary and may bundle adware. Visual Studio Community (free) or VS Code (free, open source) are the safe and sufficient openers.

Format details

in a nutshell
FULL NAMEVisual Studio Test Results Fileaka TRX test results, VSTest results file
DEVELOPERMicrosoftsince 2003 (Visual Studio .NET 2003, MSTest framework)
MIME TYPEapplication/xml
TYPEXML-based unit test run results file (text)
MAGIC BYTES · FILE SIGNATURE
OFFSET
0001020304
HEX
3C3F786D6C
ASCII
<?xml
TRX files are UTF-8 XML. They begin with the standard XML declaration: '<?xml version="1.0" encoding="UTF-8"?>' followed by a <TestRun> root element in the Microsoft XML namespace. No binary magic; the XML declaration is the identifier.

Programs that open TRX files

Windows4 apps
Microsoft Visual Studio Freemium File > Open > File, select the .trx, or use Test > Test Explorer to view results. Community edition is free.
MSTest (mstest.exe) Free MSTest generates TRX files and can re-read/republish them; use as part of .NET test pipeline configuration.
Visual Studio Code (with C# Dev Kit) Open-source Install the C# Dev Kit extension; the .NET Test Explorer can read TRX results. VS Code also opens TRX as XML with syntax highlighting.
Notepad / any text editor Open-source TRX is plain XML - open in Notepad++ with XML syntax highlighting for manual inspection of test output.
macOS2 apps
dotnet test (--logger trx) Free Same as Linux: .NET SDK on macOS generates TRX files. Install via Microsoft's .NET download page.
Visual Studio Code Open-source Open .trx as XML or use C# Dev Kit extension for test result viewing.
Linux2 apps
dotnet test (--logger trx) Free The .NET SDK on Linux generates and processes TRX files. Install .NET SDK from Microsoft; run 'dotnet test --logger trx'.
Visual Studio Code Open-source Open .trx as XML or install C# Dev Kit for integrated test result viewing.
Web1 app
Azure DevOps (Publish Test Results task) Freemium In a pipeline YAML, add 'PublishTestResults@2' task with resultFiles: '**/*.trx' and testResultsFormat: VSTest - Azure DevOps renders results in the pipeline UI.

Technical details

deep spec
File typeUTF-8 XML document (plain text)
Root XML element`<TestRun>` in the Microsoft vstst XML namespace
Schema file`vstst.xsd` - ships with Visual Studio in `Common7/IDE/`
Generator command`dotnet test --logger trx` or `mstest.exe /logger:trx`
Typical file size5 KB - 10 MB (scales with test count and stack trace verbosity)
Per-test record element`<UnitTestResult>` - stores outcome, duration, timestamps, error message, and stack trace
Summary element`<ResultSummary>` - aggregate Passed, Failed, Inconclusive, and Total counts
Results container`<Results>` element holding all `<UnitTestResult>` children
Not generated by defaultRequires explicit `--logger trx` flag; not created on a plain `dotnet test` run
Platform supportWindows, Linux, macOS (via cross-platform .NET SDK)
Azure DevOps integrationNatively parsed by the Publish Test Results pipeline task
Cross-platform CI formatJUnit XML preferred by non-Microsoft CI systems (GitHub Actions, Jenkins, GitLab CI)
Generator format variationTRX from `mstest.exe` differs slightly from TRX produced by `dotnet test`; both are valid
CompressionNone - plain XML; large test suites with stack traces can produce multi-MB files
Released2003 (Visual Studio .NET 2003, MSTest framework)
Latest versionvstst.xsd schema current as of Visual Studio 2022; vstest also generates TRX in .NET SDK 2026
Specificationlearn.microsoft.com

TRX conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with TRX files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about TRX files.

Frequently asked questions

What is a TRX file?
A TRX file is an XML test results file generated by Microsoft Visual Studio or the .NET test runner (dotnet test). It records which unit tests passed, failed, or were skipped, with timing and error details.
How do I open a TRX file?
Open it in Visual Studio (Community edition is free) to see a formatted test results view. You can also open it in any text editor (it's plain XML) or in Visual Studio Code.
How do I generate a TRX file?
Run 'dotnet test --logger trx' - this saves results to a TestResults/ folder. In Visual Studio, use the Test Explorer and export results.
How do I use a TRX file in Azure DevOps?
Add a 'PublishTestResults@2' YAML task with testResultsFormat: VSTest and resultFiles: '**/*.trx'. Azure DevOps parses TRX natively and shows pass/fail stats on the pipeline run.
How do I convert TRX to JUnit XML?
Install the trx2junit .NET global tool: 'dotnet tool install -g trx2junit' then 'trx2junit results.trx'. The output is a JUnit-compatible XML file accepted by Jenkins, GitHub Actions and GitLab CI.
What is the difference between TRX from MSTest and VSTest?
Both produce TRX files but with slightly different element layouts; the VSTest (dotnet test) variant is more up-to-date. Most TRX-parsing tools handle both, but some older tools only parse the MSTest variant.

References

1Microsoft Learn - .NET test reports (TRX logger)learn.microsoft.com
2Microsoft Learn - dotnet test commandlearn.microsoft.com

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.CRDOWNLOADChrome Partial Download File
3.PARTPartial Download File
4.DATProgram Data File (generic)
5.EXEWindows Executable (Portable Executable)
6.NOMEDIAAndroid No-Media Marker File
7.BINCD/DVD Disc Image (BIN/CUE)
8.RPMSGRestricted Permission Message
9.MDMarkdown Document
10.XDWDocuWorks Document

Related extensions

.DOStata Do-File
.MDMarkdown Document
.HEXIntel HEX File
.XSDXML Schema Definition
.MAPSource Map (JavaScript / CSS)
.CONFIGConfiguration File

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z