Community.VisualStudio.Toolkit
Community.VisualStudio.Toolkit copied to clipboard
BuildAction: Pack
I would like to trigger build action pack (available for ProjectTypes.DOTNET_CORE
. As I don't see any builtin functionality, I would implement it and create PR, but need some help:
I would extend BuildAction
enum with Pack
. But then in GetBuildFlags()
I don't find the right value of VSSOLNBUILDUPDATEFLAGS
to return. How is Visual Studio providing the command?
I'm only guessing, but the command is probably provided by an internal extension rather than as part of the core Visual Studio SDK. As you mentioned, "packing" a project can only be done for .NET SDK-style projects, so it's not really a generic type of command that could apply to other types of projects like building and cleaning can.
If you want to pack a project in your extension, the easiest solution is to just execute the command:
await VS.Commands.ExecuteAsync("Build.Packselection");
Thank you for the info and the quick help. I will try this out. Maybe this could be added to the help? I might also do this and create a PR, but it might take some time..
And as I want to learn something? Is this Build.Packselection
somewhere documented? Or how could I have known that?
Is this
Build.Packselection
somewhere documented? Or how could I have known that?
Since it's a command, you should be able to assign a shortcut key to it. So I went to Tools -> Options and then went to the Environment/Keyboard page. I searched for "pack".
To make sure that Build.Packselection
was the correct command, I assigned a keyboard shortcut to it, then I checked if the shortcut appeared next to the menu item.
And it was the correct command. 🎉