October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

How to Generate NUnit Test Reports

A practical guide to generating NUnit XML, VSTest TRX or HTML, and MTP reports, with commands, output options, and troubleshooting.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Generate NUnit test reports by first identifying the runner your project uses: NUnit Console Runner writes NUnit XML, VSTest-based dotnet test can write TRX or HTML, and Microsoft.Testing.Platform (MTP) uses registered report extensions. Choose the artifact your CI system or other consumer expects; the commands and options for these routes are not interchangeable.

Choose the report route that matches your test runner

Before changing a command, determine whether tests run through nunit3-console, VSTest-based dotnet test, or MTP. Then select a result format: NUnit XML for NUnit-oriented processing, TRX for tooling that consumes Visual Studio test results, or HTML when you need a browser-readable report.

Need Route Typical artifact
NUnit-native machine-readable results from a batch run NUnit Console Runner NUnit 3 XML, or legacy NUnit 2 XML when required
Results for CI or tools that consume Visual Studio test results VSTest-based dotnet test TRX
A standalone HTML report from VSTest-based dotnet test VSTest HTML logger HTML file
An MTP workflow Microsoft.Testing.Platform TRX or HTML through an installed report extension

NUnit’s Console Runner documentation describes a command-line batch runner. Microsoft’s VSTest dotnet test documentation covers its loggers, while its MTP report extensions documentation describes the separate MTP model.

Generate NUnit XML with NUnit Console Runner

Use the Console Runner when you want NUnit result XML from a batch execution. Point it at a test assembly or an NUnit-understood project, and specify the result file and format:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
nunit3-console MyTests.dll --result=TestResult.xml;format=nunit3

The format-qualified output specification selects native NUnit 3 XML. To request the legacy format instead, use format=nunit2:

nunit3-console MyTests.dll --result=TestResult.xml;format=nunit2

If neither --result nor --explore is supplied, the runner saves TestResult.xml in NUnit 3 format. The result file is XML, not an HTML report; use a separate transform or consumer if a human-readable presentation is needed. See NUnit’s Console Command Line documentation for result specifications and options.

Control the output location and shell parsing

The output specification can include a transform, in the form --result:filename;transform=xsltfile; the transform must handle native NUnit 3 XML. The runner also accepts --work to choose the working directory used for generated output. Because semicolons can be interpreted specially by some shells, quote or escape the result argument as appropriate for your shell. Confirm the resulting path before configuring a CI artifact collector.

Write TRX or HTML from VSTest-based dotnet test

For projects using VSTest-based dotnet test, Microsoft documents the TRX logger and HTML logger. Run one of these commands from the project or solution context:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
dotnet test --logger trx
dotnet test --logger "html;logfilename=testResults.html"

Set a results directory when you need predictable artifact placement:

dotnet test --logger trx --results-directory ./TestResults

When --results-directory is omitted, the documented default is a TestResults directory beside the project file. A TRX logger output and an HTML logger output are distinct artifacts; select the one accepted by the system that will publish or inspect the results.

Rank #3
Sale

Keep multi-targeted results separate

If a multi-targeted project uses the same explicit TRX logfilename for each target framework, the filename is reused and later output can overwrite earlier output. Use Microsoft’s documented LogFilePrefix pattern or another unique naming strategy when each target framework needs its own retained artifact. Check the current VSTest CLI documentation for the supported logger syntax.

Generate reports with Microsoft.Testing.Platform

MTP does not use VSTest logger syntax by default. Its TRX and HTML reporting routes are provided by report extension packages, which are not part of MTP core. Install and register the extension that supplies the format you want, then use the report options and filename switches supported by that extension.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set the output directory with --results-directory. If a report option such as --report-trx is unrecognized, check that the matching extension is installed and registered; confirm the available options with the test app’s --help output or dotnet test --help in MTP mode. Extension package and option details can change, so verify them against the project’s setup and Microsoft’s MTP report extensions documentation.

Understand NUnit adapter XML output

When Microsoft tooling runs NUnit tests, the NUnit3TestAdapter is part of the execution path. The adapter can also generate NUnit Test Result XML through its TestOutputXml settings. That NUnit XML is separate from the TRX or HTML produced by a VSTest logger: configure the artifact that the downstream consumer actually needs rather than assuming one replaces the other.

Adapter settings and output-folder behavior depend on adapter version. In particular, the adapter documentation identifies folder-mode behaviors introduced in versions 4.3.0 and 4.3.1. Check the installed adapter version and its settings documentation before relying on newer folder-mode values.

Troubleshoot missing, overwritten, or unusable reports

  • The command is not recognized or tests do not run: verify the project’s actual runner and execution route. A Console Runner command, VSTest logger option, and MTP report switch belong to different workflows.
  • You expected HTML but got XML: the NUnit Console Runner produces a result artifact in NUnit XML format by default. Choose the VSTest HTML logger or an MTP HTML report extension if the project uses the corresponding platform.
  • An MTP report switch is unrecognized: install and register the required report extension, then inspect the test app’s help output for the available extension options.
  • Results are missing from the expected directory: set --results-directory for VSTest or MTP, or use the Console Runner’s --work option and verify where the runner wrote the file.
  • One target framework’s TRX is missing: check whether multiple targets reused the same fixed logfilename. Use a prefix or another unique name per target.
  • A transform fails on the XML: ensure the transform is written for native NUnit 3 XML, the format selected for the Console Runner output.
  • Adapter XML is not where expected: verify the installed NUnit3TestAdapter version and the relevant TestOutputXml setting, including version-specific folder-mode behavior.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose names and formats for the consumer

Confirm these points before wiring report generation into a build:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Which runner or platform executes the tests?
  • Does the CI service or downstream tool accept NUnit XML, TRX, or HTML?
  • Does the audience need machine-readable results for processing or an HTML view for inspection?
  • Will multi-targeted runs produce separate files, and are their names unique?
  • Is the output path stable and included in the CI artifact collection?

Or skip the browser setup

If you also need a screenshot of a report page or another web page, ScreenshotNeo can return an image or PDF from one request. For example, capture a report URL as WebP:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/report -o shot.webp

See the ScreenshotNeo API documentation for request options. Cookie banners are accepted and removed before capture, along with known newsletter popups and chat widgets; those cleanup steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. An MCP server provides screenshot tools for AI agents, and the Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo free: 1,000 screenshots a month, no card required.

Frequently Asked Questions

Does NUnit Console Runner create an HTML report by default?

No. Its default result artifact is NUnit 3 XML.

Can a project produce both NUnit XML and TRX?

Yes, when the selected runner and adapter/logger configuration supports each artifact; configure each output separately.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Where can I confirm which MTP report options are available?

Check the test app’s --help output or dotnet test --help in MTP mode, and verify the registered report extensions.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.