Skip to content

Ship Microsoft.Diagnostics.NETCore.Client in Microsoft.TestPlatform and Portable packages - #16631

Closed
Jakub Jareš (nohwnd) wants to merge 1 commit into
microsoft:mainfrom
nohwnd:nohwnd-hangdump-netfx-console-acceptance-draft
Closed

Jakub Jareš (nohwnd) wants to merge 1 commit into
microsoft:mainfrom
nohwnd:nohwnd-hangdump-netfx-console-acceptance-draft

Conversation

@nohwnd

Copy link
Copy Markdown
Member

Description

/Blame:CollectHangDump fails when the Microsoft.TestPlatform package console (net462) drives a .NET testhost:

Could not load file or assembly 'Microsoft.Diagnostics.NETCore.Client, Version=0.2.14.41219 ...'
Collect dump was enabled but no dump file was generated.

BlameDataCollector needs Microsoft.Diagnostics.NETCore.Client.dll to dump .NET testhosts, but only Microsoft.TestPlatform.CLI shipped it. Microsoft.TestPlatform and Microsoft.TestPlatform.Portable did not.

Now both packages put the DLL next to Microsoft.TestPlatform.Extensions.BlameDataCollector.dll. eng/expected-nupkg-file-counts.json and eng/expected-dll-frameworks.json are regenerated by a clean Release -pack build.

We did not catch it because HangDumpOnTimeout was pinned to the .NET console, which comes from the CLI package. It now runs with both consoles and both testhosts. Before the packaging change the net462 console + .NET testhost row failed with the error above, now all 4 rows pass (1m 30s).

Related issue

Reported by email, no issue filed.

  • I have ensured that there is a previously discussed and approved issue.

🤖

…nd Portable packages

BlameDataCollector needs it to create hang dumps of .NET testhosts. Only
Microsoft.TestPlatform.CLI shipped it, so the net462 console failed with
FileNotFoundException. Run HangDumpOnTimeout with both consoles and testhosts.

Co-authored-by: Copilot App <[email protected]>
@nohwnd

Copy link
Copy Markdown
Member Author

Opened by mistake, continuing in #16630. 🤖

@nohwnd
Jakub Jareš (nohwnd) deleted the nohwnd-hangdump-netfx-console-acceptance-draft branch November 4, 2026 11:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the dependency-packaging fix for hang-dump collection.

No open issues 🎉

What changed in this PR

Fixes missing dependency packaging that prevents /Blame:CollectHangDump from capturing dumps of .NET testhosts when using the .NET Framework console.

Changes:

  • Ships Microsoft.Diagnostics.NETCore.Client.dll beside the blame collector in Microsoft.TestPlatform and both Portable tool layouts.
  • Expands HangDumpOnTimeout coverage to both console and testhost families.
  • Updates package file-count and DLL-framework baselines for the added assemblies.
File Description
test/​Microsoft.TestPlatform.Acceptance.IntegrationTests/​BlameDataCollectorTests.cs Expands the hang-dump test matrix.
src/​package/​Microsoft.TestPlatform/​Microsoft.TestPlatform.csproj Packages the diagnostics client beside the blame collector.
src/​package/​Microsoft.TestPlatform.Portable/​Microsoft.TestPlatform.Portable.csproj Adds the diagnostics client to net462 and net8.0 layouts.
eng/​expected-nupkg-file-counts.json Accounts for one additional file in TestPlatform and two in Portable.
eng/​expected-dll-frameworks.json Records the added diagnostics client assemblies as .NET Standard.

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants