Skip to content

VSSDK in-proc accessing extensibility service through this.GetServiceAsync(typeof(VisualStudioExtensibility)) fails. #533

@mitchcapper

Description

@mitchcapper

Here is a modified version of the composite example to illustrate the issue. https://github.com/mitchcapper/VSExtensibility/tree/hybrid_project_fails. Most of it is just adding full VSSDK entrpoints here you can see the issue (commented out the crash one): https://github.com/mitchcapper/VSExtensibility/blob/hybrid_project_fails/New_Extensibility_Model/Samples/CompositeExtension/CompositeExtension/CompositExtensionPackage.cs#L29-L38

It is documented that one should be able to access the new apis from composite/hybrid extensions by getting the service. Unfortunately this fails do to assembly mismatch.

Calling await this.GetServiceAsync(typeof(VisualStudioExtensibility)); or this.GetServiceAsync<VisualStudioExtensibility,VisualStudioExtensibility>(); does not work as different assembly versions and cannot be converted. The first version does return it ie:
Global service fetch returned: Microsoft.VisualStudio.Extensibility.VisualStudioExtensibility, Microsoft.VisualStudio.Extensibility.Framework, Version=18.0.96.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a but we requested: Microsoft.VisualStudio.Extensibility.VisualStudioExtensibility, Microsoft.VisualStudio.Extensibility.Framework, Version=17.14.2088.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

The second typed one just throws an exception as it cant cast it to that type. This wouldn't be an issue but due to the Extensibility design I can't seem to easily trigger a normal entrypoint that would have it injected without waiting for a user to manually click a button (which doesn't work for my case). I maintain an extension: https://github.com/mitchcapper/JustMyCodeToggle/ for allowing you to control various options like JustMyCode or Symbol Loading from the command bar or shortcuts. VS2026 broke several methods that worked in VS2022 and the only way I have found to set debugging.symbols.load.moduleFilterMode now is through the new unified store. Except I can't figure out how to get access to the unified store due to this and one other issue:)

I could maybe use a compiled set of expressions to be able to work with the wrong typed version but that isn't probably the best solution.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions