Merged
Conversation
VS 17.14 ships Microsoft.Bcl.AsyncInterfaces 9.0.0.0 and devenv.exe.config binding-redirects 0-9.0.0.0 to that version. Anything in the Vsix that references >9.0.0.0 falls outside the redirect, so devenv loads a second copy from the extension folder, producing duplicate IAsyncDisposable type identities and silent runtime failures. CodeConverter was transitively pulling in Microsoft.Bcl.AsyncInterfaces 10.0.0.0 via System.Linq.AsyncEnumerable (which only ships as a 10.x package) and System.Text.Json 10.0.0. Drop those package references from CodeConverter and hand-roll the small subset of System.Linq.AsyncEnumerable we actually used (ToArraySafeAsync, AsAsyncEnumerable, SelectSafe). The helpers are deliberately renamed so they do not clash with .NET 10's BCL System.Linq.AsyncEnumerable extension methods when referenced by a multi-targeted consumer. System.Linq.AsyncEnumerable is added directly to CodeConv.csproj instead - the CLI tool never loads into devenv.exe so the binding-redirect ceiling does not apply there. Add VsixAssemblyCompatibilityTests that statically walks the Vsix output via PEReader and asserts every referenced version of a known VS-owned polyfill (currently Microsoft.Bcl.AsyncInterfaces) is satisfiable by the version the oldest supported VS ships. The test reproduces the original bug and now passes.
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.
There's a new half-implemented way to do extensions that you mix and match with the current way.
The output window and options pane stuff seems to still be in preview, but the package/commands can be converted.
The main thing is that it allows you to use sdk-style projects which are much less clunky
There's an issue with the asyncinterfaces dll that theruntime assembly binding redirect hack code can work around, but ideally wouldn't have to, so I've tried to not depend on it. Someone with vs2022 will need to test this before we'll know for sure it's fine