Asha
Asha

Reputation: 11232

How to build the project which contains the active file in visual studio?

I am using visual studio 2010. My code is in C++ and my solution contains many projects and each project again contains multiple folders under it. Whenever I change a file it gets automatically selected in solution explorer as I have enabled the option "Track Active Item in Solution Explorer" in Tools->Options->Projects and Solutions->General. But after changing the file I have to manually select the project (this could be cumbersome as I have to scroll up and down due to many files present) and then right click on it and select "build". Is there any other simple way to do this?

Upvotes: 2

Views: 342

Answers (1)

Arialdo Martini
Arialdo Martini

Reputation: 4567

You could assign a shortcut to Build.BuildSelection or Build.BuildOnlyProject

Go to Tools menu, then Options=>Environment=>Keyboard and enter Build.BuildSelection or Build.BuildOnlyProject in the Show commands containing search text area. Then assign two free shortcuts. Build.BuildSelection is for building the current file; Build.BuildOnlyProject will build its project.

I use ctrl-shift+b to build all the solution. I hate to use the mouse for those repetitive tasks.

Upvotes: 5

Related Questions