You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But when I select a project that has no "JavaScript" capability, the extension is still active (I can access its commands, etc.).
For checking the project capabilities, I use the VS.Extensibility API. I simply query the solution for its projects and then inspect the project capabilities listed in the Capabilities property. Here is the code:
varprojects=awaitcontext.Extensibility.Workspaces().QuerySolutionAsync(
query =>query.Get(solution =>solution.Projects).With(p =>p.Name).With(p =>p.TypeGuid).With(p =>p.Capabilities).With(p =>p.Guid).With(p =>p.Kind).With(p =>p.Type),cancellationToken);// there is only one project in the solution so I'm indexing 0varcapabilities=projects[0].Capabilities
The capabilities variable contains a list with the CSharp capability (and more), but no capability for JavaScript (which is right, because the project is CSharp).
So my issue is that even though the project is CSharp and not JavaScript, the extension is available to use, which is not what I need.
UPDATE:
I've just noticed that even though I run a completely different extension from a completely different project, the commands are still available, so maybe the problem is that there is something old in the cache. However, the current dll (the one with the extension configuration) is loaded because the breakpoints in this project are hit, so maybe my issue is actually not related to this observation.
The text was updated successfully, but these errors were encountered:
i-m-luke
changed the title
ExtensionConfiguration.LoadedWhen: Extension is active for projects that doesn't meet defined ActivationConstraint.ActiveProjectCapability
ExtensionConfiguration.LoadedWhen: Extension is active for projects that don't meet defined ActivationConstraint.ActiveProjectCapability
Oct 4, 2024
i-m-luke
changed the title
ExtensionConfiguration.LoadedWhen: Extension is active for projects that don't meet defined ActivationConstraint.ActiveProjectCapability
ExtensionConfiguration.LoadedWhen: Extension is active for projects that do not meet defined ActivationConstraint.ActiveProjectCapability
Oct 4, 2024
My goal is to create an extension that will be active only for projects with specific ProjectCapabilities (e.g., ProjectCapability.JavaScript).
I've implemented this configuration in the extension entrypoint class:
But when I select a project that has no "JavaScript" capability, the extension is still active (I can access its commands, etc.).
For checking the project capabilities, I use the VS.Extensibility API. I simply query the solution for its projects and then inspect the project capabilities listed in the Capabilities property. Here is the code:
The capabilities variable contains a list with the CSharp capability (and more), but no capability for JavaScript (which is right, because the project is CSharp).
So my issue is that even though the project is CSharp and not JavaScript, the extension is available to use, which is not what I need.
UPDATE:
I've just noticed that even though I run a completely different extension from a completely different project, the commands are still available, so maybe the problem is that there is something old in the cache. However, the current dll (the one with the extension configuration) is loaded because the breakpoints in this project are hit, so maybe my issue is actually not related to this observation.
The text was updated successfully, but these errors were encountered: