Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 482
jtubre Avatar asked Mar 24 '16 16:03

jtubre


People also ask

What is the shortcut key of publish?

SHIFT + P to open the publish menu. SHIFT + Enter to publish to all domains.

What is Ctrl Shift F in Visual Studio?

Ctrl-Shift-F is used to find all the ocuurance of a string with in entire solution and display find result window as shown below. Ctrl-F is used to find a string in the current document, project and all open documents one by one.

What does Ctrl w do in Visual Studio?

All the browsers I know give you the option to close tabs using Ctrl+W in addition to the standard Ctrl+F4 in Windows.


3 Answers

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
like image 157
ellockie Avatar answered Sep 28 '22 10:09

ellockie


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.

like image 27
Luis Hernandez Avatar answered Sep 28 '22 10:09

Luis Hernandez


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.

like image 45
Jim Aho Avatar answered Sep 28 '22 11:09

Jim Aho