visual-studio 是否有用于在 Visual Studio 中构建当前项目的标准键盘快捷键?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/247745/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 09:49:42  来源:igfitidea点击:

Is there a standard keyboard shortcut to build the current project in Visual Studio?

visual-studiokeyboard-shortcuts

提问by Luke

I know that Ctrl+ Shift+ Blaunches a solution build, but I would like a shortcut that just builds the current project. Is a custom shortcut my only option?

我知道Ctrl+ Shift+B的推出解决方案的构建,但我想一个快捷方式,只需建立当前项目。自定义快捷方式是我唯一的选择吗?

Edit:Looks like a custom shortcut is my only option as Shift+ F6does not work for me.

编辑:看起来自定义快捷方式是我唯一的选择,因为Shift+F6对我不起作用。

回答by Metro Smurf

Assigning the shortcut to "Build.BuildOnlyProject" command doesn't seem to work in VS2008.

将快捷方式分配给“Build.BuildOnlyProject”命令似乎在 VS2008 中不起作用。

Assign the shortcut to "Build.BuildSelection". If you have a solution with several projects and files open from the various projects, whatever file you are currently editing will define the project that will be built when you use the assigned shortcut for "Build.BuildSelection".

将快捷方式分配给“ Build.BuildSelection”。如果您有一个解决方案,其中包含多个项目和从各个项目打开的文件,则您当前正在编辑的任何文件都将定义在您使用“Build.BuildSelection”分配的快捷方式时将构建的项目。

You'll know the keyboard shortcut is working when you click the Build menu option and you see the keyboard shortcut on the menu itself.

当您单击“构建”菜单选项并在菜单本身上看到键盘快捷键时,您就会知道键盘快捷键正在工作。

btw - a restart/reboot is not required when assigning keyboard shortcuts.

顺便说一句 - 分配键盘快捷键时不需要重新启动/重新启动。

回答by Keith Nicholas

custom shortcut depending on what keybindings you are using.....if you look in your menu it will tell you if you have a keybinding.

自定义快捷方式取决于您使用的键绑定.....如果您查看菜单,它会告诉您是否有键绑定。

The other thing I have got used to, because I make use of ViEmu, is use the menu shortcuts. Which are actually quite quick to do, and are independent of bindings.

我习惯的另一件事是使用菜单快捷方式,因为我使用 ViEmu。这实际上很快就可以完成,并且独立于绑定。

  • So to build your project you go Alt+ B, U
  • 所以要构建你的项目,你去Alt+ BU

回答by Darien Pardinas

You can use the shortcuts already established in the main menu that are navigated with the Alt key:

您可以使用已在主菜单中建立的通过 Alt 键导航的快捷方式:

At least for VS2013:

至少对于 VS2013:

Alt + B, B -> Build Solution
Alt + B, R -> Rebuild Solution
Alt + B, U -> Build current project
Alt + B, E -> Rebuild current project

For some reason after installing Resharper I couldn't get a global shortcut to work (tried several times!!!), but as long as what you want to do is on the main menu, there is always an Alt + "Letter1", "Letter2" combination to trigger whatever action you'd like :-)

由于某些原因,安装 Resharper 后我无法获得全局快捷方式工作(尝试了几次!!!),但是只要您想要做的是在主菜单上,总会有一个 Alt +“Letter1”, “Letter2”组合可触发您想要的任何操作:-)

回答by Alexandr

For C# development:

对于 C# 开发:

F6or Shift+Ctrl+B- Builds all the projects in the solution.

F6Shift+ Ctrl+ B- 构建解决方案中的所有项目。

Shift+F6- Builds the selected project and its dependencies.

Shift+ F6- 构建选定的项目及其依赖项。

回答by Raffaeu

Visual Studio 2015/17

视觉工作室 2015/17

ALT+ B+ E

ALT+ B+E

ALT+ B= Open Build Menu

ALT+ B= 打开构建菜单

E= Rebuild Current Project

E= 重建当前项目

回答by Don Rolling

VS 2012 has Shift+ F6already mapped for this. I was surprised to learn this.

VS 2012已经Shift+F6已经映射这一点。我很惊讶地了解到这一点。

回答by Saar

for C# development. Tools -> Options. Select Keyboard, select additional keyboard mapping scheme to "Visual C# 2005". This mapping has F6as standard shortcut.

用于 C# 开发。工具 -> 选项。选择键盘,选择附加键盘映射方案到“Visual C# 2005”。此映射具有F6标准快捷方式。

回答by Michael M

For Visual Studio 2017 community, you can use Alt+bthen press uto build your current project.

对于 Visual Studio 2017 社区,您可以使用Alt+b然后按u构建您当前的项目。

Details: ALT Switch to the main menu -> choose b for build -> u choose the option of build your_project_name from the drop list.

详情:ALT 切换到主菜单 -> 选择 b 进行构建 -> u 从下拉列表中选择构建 your_project_name 的选项。

回答by Mohammed Noureldin

In Visual Studio 2017and 2019, Shift+ F6works for me.

在 Visual Studio 20172019 中Shift+F6对我有用。

回答by mattferderer

In Visual Studio 2019 this has been set to Ctrl+b

在 Visual Studio 2019 中,这已设置为Ctrl+b