How to define a keyboard shortcut to create a default project in the VC ++ IDE?

Visual Studio for C ++ defines the F7 key combination to build the entire solution. However, it does not define a keyboard shortcut to create a default project.

Usually a solution contains many projects, and one of the projects defaults. If I changed the code in the default project and want to create it, I have to use the mouse to right-click the project name and right-click on it and select the "build" menu. It is slow and tiring.

Is there a way to define a keyboard shortcut, such as F4, to create a default project?

+6
source share
3 answers

You will not indicate which version of Visual Studio you have, but in VS2012 you can create a key combination to create the current project.

Select “Tools / Options” from the menu, and then select “Keyboard” in the “Environment” section and find the desired action to assign any key combination that you like:

build

Just click the Shortcut button and press the key combination that you need.

Having said that, it is usually for the solution to contain related projects, and for some or all of these projects to have dependencies, for example, a static lib and consuming executable file. As long as all other projects in the solution have already been built, pressing F7 to build the solution will only build what is needed based on what you changed. Thus, there should be a bit of overhead.

If your solution has grouped projects for another reason (for example, as part of a larger assembly), you can always create a separate solution that simply contains one project, and then use F7 without having to make a key combination.

+3
source

In VS2013, I needed to use the Build.BuildSelection command instead of Build.BuildOnlyProject .

enter image description here

+13
source

In VS 2013, in the BUILD menu, you will see the Assembly> section after the Assembly> section. You will see that Shift + F6 is already assigned to Build ErrorHandler , the default project.

Build menu

You can also add the Create toolbar. The first button on it should be the Create Selection button.

Build toolbar

+1
source

Source: https://habr.com/ru/post/954127/


All Articles