You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to get MSBuild binary logs from MTP with dotnet test? #6719
I have a custom MSBuild target that I call ReportGenerator with, which is defined with AfterTargets="InvokeTestingPlatform", but it isn't firing.
I tried to debug this with an MSBuild binary log, but the log doesn't appear to contain any trace of the InvokeTestingPlatform target.
I ran dotnet test -bl, which generates msbuild.binlog and msbuild-dotnet-test.binlog, but neither find the InvokeTestingPlatform target in it, but I know it's running as I can see the effects of another target I have that is defined with BeforeTargets="_MTPAddArguments;InvokeTestingPlatform".
I can see the MTP build in msbuild.binlog:
But msbuild-dotnet-test.binlog doesn't appear to contain anything other than evaluation:
If you are talking about the MTP-based dotnet test that is shipping in .NET 10, we don't invoke any MSBuild targets for running tests. The whole logic is embedded in the dotnet(.exe) process where we start the test app as child processes. Collecting coverage via MSBuild is unfortunately not supported.
Given we are not using MSBUild tasks to run tests, this would require a large re-engineering. Given we have limited resource and there aren't many requests so far, I'll move forward as won't fix.
We will obviously reconsider if something changes.
Activity
Youssef1313 commentedon Oct 10, 2025
If you are talking about the MTP-based
dotnet testthat is shipping in .NET 10, we don't invoke any MSBuild targets for running tests. The whole logic is embedded in the dotnet(.exe) process where we start the test app as child processes. Collecting coverage via MSBuild is unfortunately not supported.martincostello commentedon Oct 10, 2025
I'm confused - I use MSBuild targets to customise the arguments to MTP before it's invoked...
I just made a change to them to double check:
Youssef1313 commentedon Oct 10, 2025
_MTPAddArgumentsis run (we do it programmatically here), but notInvokeTestingPlatform. The actual test execution doesn't happen via any targets.martincostello commentedon Oct 10, 2025
Ah, that explains why I just need to make this change to add
_MTPAddArguments: martincostello/build-kit@0f225e0So basically my whole MSBuild customization setup is junked by MTP v2?
martincostello commentedon Oct 10, 2025
For clarity, I'm not collecting coverage - I'm running ReportGenerator to post-process the output from the tests to generate human-readable reports.
Youssef1313 commentedon Oct 10, 2025
fwiw, for adjusting
TestingPlatformCommandLineArguments, it's better to not rely on_MTPAddArgumentsand useComputeRunArgumentsinstead.For ReportGenerator, we need to discuss internally how to best move forward here. The initial plan was to not have any MSBuild hooks here for
dotnet test. FYI Jakub Jareš (@nohwnd) Chet Husk (@baronfel) Mariam Abdullah (@mariam-abdulla)Use a different target for MTP
Use a different target for MTP
Use xUnit v3 through Microsoft Testing Platform
Use xUnit v3 through Microsoft Testing Platform
Use xUnit v3 through Microsoft Testing Platform
Evangelink commentedon May 28, 2026
Given we are not using MSBUild tasks to run tests, this would require a large re-engineering. Given we have limited resource and there aren't many requests so far, I'll move forward as won't fix.
We will obviously reconsider if something changes.
Use xUnit v3 through Microsoft Testing Platform