Skip to content

Remove DiagnosticSource binding redirect (rel/18.6)#15776

Merged
nohwnd merged 2 commits into
microsoft:rel/18.6from
nohwnd:fix-diag-redirect-18.6
May 14, 2026
Merged

Remove DiagnosticSource binding redirect (rel/18.6)#15776
nohwnd merged 2 commits into
microsoft:rel/18.6from
nohwnd:fix-diag-redirect-18.6

Conversation

@nohwnd
Copy link
Copy Markdown
Member

@nohwnd nohwnd commented May 14, 2026

Remove the System.Diagnostics.DiagnosticSource binding redirect from testhost, datacollector, and vstest.console app.configs.

The redirect (added in #15567) points to assembly version 8.0.0.1, but the DLL is excluded from the CLI package in the .nuspec. On net462 with DisableAppDomain=true, the testhost's redirect is active in the test AppDomain — it rewrites DiagnosticSource requests to 8.0.0.1, which doesn't exist, causing MissingMethodException in the assembly resolver.

Fixes #15765

The binding redirect for System.Diagnostics.DiagnosticSource (8.0.0.1)
was added in microsoft#15567 but the DLL is excluded from the CLI package during
packaging. The redirect points to a version that doesn't ship, causing
MissingMethodException on net462 with DisableAppDomain=true when a test
triggers assembly resolution for DiagnosticSource.

Fixes microsoft#15765

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…soft#15778)

* Error on binding redirects pointing to missing DLLs

Change verify-binding-redirects.ps1 to fail when a binding redirect
references a DLL that isn't in the package layout. Previously this was
silently skipped, which allowed microsoft#15765 — a redirect for
DiagnosticSource 8.0.0.1 shipped in the config but the DLL was
excluded from the package.

The whole-package-missing case (VMR) is still a skip.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove stale DiagnosticSource and Encodings.Web redirects from vstest.console

The hardened validation script caught two more orphaned binding redirects
in vstest.console/app.config — both DLLs are explicitly excluded from
the CLI package nuspec.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix review feedback: fail locally on missing-DLL errors

- Missing-DLL errors now Write-Error instead of reporting success
- CI message distinguishes version mismatches (auto-fixable) from
  missing-DLL errors (manual removal needed)
- Addresses Copilot review comments on lines 133 and 138

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix em-dash encoding in verify-binding-redirects.ps1

Replace Unicode em-dash (U+2014) with ASCII hyphen in comments and
strings. The em-dash gets corrupted to multi-byte garbage on CI's
PowerShell, causing a parse error that breaks the entire validation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove FileSystemGlobbing from allow-list

It ships in the package, so allowing it would mask a future
packaging regression.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nohwnd nohwnd force-pushed the fix-diag-redirect-18.6 branch from 2043de9 to 4ace679 Compare May 14, 2026 15:16
@nohwnd nohwnd merged commit e2f2483 into microsoft:rel/18.6 May 14, 2026
3 of 6 checks passed
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.

1 participant