-
Notifications
You must be signed in to change notification settings - Fork 17
fix the assembly resolver to prevent recursion and version mismatches #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix the assembly resolver to prevent recursion and version mismatches #88
Conversation
loop8ack
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my review comments.
Regarding package references:
Why are these packages added to all projects:
- Community.VisualStudio.Toolkit.15
- MessagePack
- Microsoft.IO.Redist
- System.Text.Json
The adapter project is designed to resolve version conflicts at runtime via IL generation. Adding Toolkit.15 to all core projects breaks this isolation.
Also, System.Text.Json should only be updated in the Manifest project where it's actually used.
PS: Sorry for any email spam earlier – I was testing Rider's GitHub review tools, but they turned out to be buggy
src/ExtensionManager.UI/ViewModels/InstallExportDialogViewModel.cs
Outdated
Show resolved
Hide resolved
src/ExtensionManager.VisualStudio.Adapter.Generator/Internal/GeneratorReflector.cs
Outdated
Show resolved
Hide resolved
...nager.VisualStudio.Adapter.Generator/Types/Extensions/ExtensionRepositoryAdapterGenerator.cs
Outdated
Show resolved
Hide resolved
… have ExtensionManager installed: fixed the assembly resolver to prevent recursion and version mismatches.
e845aea to
4f17ea2
Compare
@loop8ack thank you for the quick review! I reduced the scope of this PR to really what is necessary. I still kept the bump on Text.Json pacakge for a critical vulnerability, but dropped all the other unnecessary changes. The goal of this PR is to prevent a potential stack overflow caused by the extension’s assembly resolver. When the C++ workload (“Desktop development with C++” in VS2026) is not installed, the extension ships its own copy of MS.VS.VCProjectEngine.dll, but at version 17 rather than the current version 18 provided by the workload. Because of the binding redirect and the legacy .NET Framework assembly resolution behavior (different from modern .NET), this can trigger a recursive resolution loop that leads to a stack overflow. The changes in this PR avoid that issue by ensuring the attempt to load the older v17 VCProjectEngine.dll happens only once. |
|
I tried to reproduce the error, but it works for me with Visual Studio 2026 Insiders (11312.210) Do you have any further information about the recursion? Do you know which libraries are responsible for it and how they reference each other? I'm also a little hesitant about your solution:
|
Prevent StackOverflow exceptions in Visual Studio 2026 for users who have ExtensionManager installed: fixed the assembly resolver to prevent recursion and version mismatches