Skip to content

Embed missing System.Text.Json transitive dependencies in PerfView#2404

Merged
brianrob merged 1 commit into
microsoft:mainfrom
brianrob:brianrob/missing-stj-deps
Apr 4, 2026
Merged

Embed missing System.Text.Json transitive dependencies in PerfView#2404
brianrob merged 1 commit into
microsoft:mainfrom
brianrob:brianrob/missing-stj-deps

Conversation

@brianrob
Copy link
Copy Markdown
Member

@brianrob brianrob commented Apr 4, 2026

Summary

The self-extracting PerfView EXE is missing two transitive dependencies of System.Text.Json 9.0.8:

  • System.IO.Pipelines.dll
  • Microsoft.Bcl.AsyncInterfaces.dll

Without these DLLs, System.Text.Json silently fails when parsing ProcessMappingMetadata.SymbolMetadata JSON strings during nettrace-to-ETLX conversion. This causes ParsedSymbolMetadata to return null, so MatchOrInitElf()/MatchOrInitPE() are never called, symbolInfo stays null, and BinaryFormat returns Unknown — breaking ELF symbol resolution for Linux .nettrace traces.

Root Cause

PerfView embeds DLLs as EmbeddedResource items in PerfView.csproj. System.Text.Json and its direct dependency System.Text.Encodings.Web were already embedded, but the transitive dependencies System.IO.Pipelines and Microsoft.Bcl.AsyncInterfaces were not. Local builds work because the output directory contains all transitive NuGet dependencies, but the official self-extracting EXE only includes explicitly listed resources.

Verification

Configuration ELF Modules PE Modules
Official 3.2.0 (missing deps) 0 0
Official + 2 missing DLLs added 83 34
Local build (all deps present) 83 34

Changes

  • src/Directory.Packages.props: Added System.IO.Pipelines and Microsoft.Bcl.AsyncInterfaces v9.0.8
  • src/PerfView/PerfView.csproj: Added PackageReference with GeneratePathProperty="true" and EmbeddedResource entries for both DLLs

Testing

  • Full build succeeds
  • All 4565 TraceEvent tests pass (2271 net8.0 + 2288 net462 + 6 skipped)
  • Standalone ETLX conversion test confirms correct module binary format detection
  • End-to-end validation: isolated self-extracting PerfView.exe correctly extracts both DLLs and produces ETLX with 166 ElfSymbolInfo + 68 PESymbolInfo objects

System.Text.Json 9.0.8 has transitive dependencies on System.IO.Pipelines
and Microsoft.Bcl.AsyncInterfaces that were not being embedded in the
self-extracting PerfView EXE. When these DLLs are absent at runtime,
System.Text.Json fails to parse ProcessMappingMetadata JSON, causing all
ELF and PE module binary formats to be reported as Unknown. This prevents
symbol resolution for Linux .nettrace traces.

Add both packages to Directory.Packages.props and embed them as resources
in PerfView.csproj alongside the existing System.Text.Json dependencies.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@brianrob brianrob marked this pull request as ready for review April 4, 2026 05:05
@brianrob brianrob requested a review from a team as a code owner April 4, 2026 05:05
@brianrob brianrob merged commit afe5e5d into microsoft:main Apr 4, 2026
5 checks passed
@brianrob brianrob deleted the brianrob/missing-stj-deps branch April 4, 2026 15:37
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