Reputation: 699
I'm aware of Build.PublishSelection as a shortcut to pull up the publish project window (and publish the entire project), but I would like to bind something to publish just the current file I'm editing. You can right click the file in solution explorer and publish it, but I have to do this 200+ times a day and those seconds add up.
Any hotkey command to do this or other possible workaround?
Upvotes: 8
Views: 6475
Reputation: 628
Visual Studio 2022: Alt + B, H and hit Enter.
Visual Studio 2019: Alt + B, H and hit Enter.
Visual Studio 2017: Alt + ', Alt + P and hit Enter.
Creating a shortcut (works in any version): Go to Tools > Options > Environment > Keyboard
, look for Build.PublishSelection
, in Press shortcut keys
type e.g. Alt + P and click on Assign
.
Upvotes: 5
Reputation: 4278
In Visual Studio Enterprise 2017 this is the shortcut sequence (basically a path to the publish menu item):
Upvotes: 7
Reputation: 11937
For Visual Studio 2015:
Alt + ¨, Alt + P
will publish the currently selected file(s).
The ¨
key is the one just left of the enter
key.
Upvotes: 3