Skip to content

VS Extensibility#1258

Merged
GrahamTheCoder merged 9 commits intoicsharpcode:masterfrom
GrahamTheCoder:claude/fix-asyncinterfaces-vs-compatibility-lIFLk
Apr 14, 2026
Merged

VS Extensibility#1258
GrahamTheCoder merged 9 commits intoicsharpcode:masterfrom
GrahamTheCoder:claude/fix-asyncinterfaces-vs-compatibility-lIFLk

Conversation

@GrahamTheCoder
Copy link
Copy Markdown
Member

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

GrahamTheCoder and others added 9 commits March 1, 2026 16:37
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.
@GrahamTheCoder GrahamTheCoder merged commit 2bb1568 into icsharpcode:master Apr 14, 2026
0 of 3 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.

2 participants