Skip to content

VS.Services.GetCommandServiceAsync does not work #92

@reduckted

Description

@reduckted

The VS.Services.GetCommandServiceAsync() method does not seem to ever work because the service is never found.

I don't know why, but it seems that the IMenuCommandService can only be retrieved from a Package and not from the global service provider.

IMenuCommandService fromGlobal = await VS.GetServiceAsync<IMenuCommandService, IMenuCommandService>();
IMenuCommandService fromPackage = await this.GetServiceAsync<IMenuCommandService, IMenuCommandService>();
// `this` is a Package object.

await VS.MessageBox.ShowAsync(
    "From Global: " + ((fromGlobal is null) ? "null" : "not null") + "\r\n" +
    "From Package: " + ((fromPackage is null) ? "null" : "not null")
);

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions