jtubre
jtubre

Reputation: 699

Visual Studio Keyboard Shortcut / Hot key to Publish Current File

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

Answers (3)

Luis Hernandez
Luis Hernandez

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

ellockie
ellockie

Reputation: 4278

In Visual Studio Enterprise 2017 this is the shortcut sequence (basically a path to the publish menu item):

  1. Alt+B - opens the "Build" menu
  2. H - selects: "Publish your_solution_name", selects the "Publish" button
  3. Enter - confirms

Upvotes: 7

Jim Aho
Jim Aho

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

Related Questions