Replace VSSDK-sourced DLLs with proper package references#15567
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the VSIX packaging project to source System.Diagnostics.DiagnosticSource from its own NuGet package (instead of VSSDK build tools) and removes redundant VSSDK-sourced DLL references/properties.
Changes:
- Add
PackageReferencetoSystem.Diagnostics.DiagnosticSourcewithGeneratePathPropertyenabled. - Update VSIX file inclusion to pull
System.Diagnostics.DiagnosticSource.dllfrom the restored NuGet package path and remove the VSSDK-sourcedUnsafeinclusion. - Remove the now-unused
VSSDKBuildToolsFolderMSBuild property and introduce a central version property for the new package.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/package/Microsoft.VisualStudio.TestTools.TestPlatform.V2.CLI/Microsoft.VisualStudio.TestTools.TestPlatform.V2.CLI.csproj | Switches VSIX DLL sourcing from VSSDK folder to a NuGet package path generated by GeneratePathProperty. |
| eng/Versions.props | Adds a central version property for System.Diagnostics.DiagnosticSource. |
Source System.Diagnostics.DiagnosticSource from its own NuGet package instead of from the Microsoft.VSSDK.BuildTools package. Add a PackageReference with GeneratePathProperty and reference the DLL via the generated path property. Remove the redundant VSSDK-sourced System.Runtime.CompilerServices.Unsafe entry since it is already included from the TestPlatform build output. Remove the now-unused VSSDKBuildToolsFolder property. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add binding redirect for System.Diagnostics.DiagnosticSource (8.0.0.1) to vstest.console, testhost.x86, and datacollector app.config files. This is needed after replacing the VSSDK-sourced DLL with the 8.0.1 NuGet package. Also fix vstest.console/app.config which had a duplicate System.Runtime.CompilerServices.Unsafe entry, and widen the Unsafe oldVersion range from 1.0.0.0 to 0.0.0.0 in all three config files to cover all possible version requests. Verified System.Runtime.CompilerServices.Unsafe assembly version (6.0.0.0) matches the existing newVersion in binding redirects. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This was referenced Mar 27, 2026
This was referenced May 14, 2026
nohwnd
added a commit
that referenced
this pull request
May 14, 2026
* Remove DiagnosticSource binding redirect from app.configs The binding redirect for System.Diagnostics.DiagnosticSource (8.0.0.1) was added in #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 #15765 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * [fix] Harden binding redirect validation to catch missing DLLs (#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 #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> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
nohwnd
added a commit
that referenced
this pull request
May 14, 2026
* Remove DiagnosticSource binding redirect from app.configs The binding redirect for System.Diagnostics.DiagnosticSource (8.0.0.1) was added in #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 #15765 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * [fix] Harden binding redirect validation to catch missing DLLs (#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 #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> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #15504
Source \System.Diagnostics.DiagnosticSource\ from its own NuGet package instead of from the \Microsoft.VSSDK.BuildTools\ package. Add a \PackageReference\ with \GeneratePathProperty\ and reference the DLL via the generated path property.
Remove the redundant VSSDK-sourced \System.Runtime.CompilerServices.Unsafe\ entry since it is already included from the TestPlatform build output.
Remove the now-unused \VSSDKBuildToolsFolder\ property.