Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here
You can use MSBuild.exe to build specific targets of specific projects in a solution.
At the command line, type MSBuild.exe <SolutionName>.sln
, where <SolutionName>
corresponds to the file name of the solution that contains the target that you want to execute.
Specify the target after the /t switch in the format ProjectName:TargetName.
The following example executes the Rebuild
target of the NotInSlnFolder
project, and then executes the Clean
target of the InSolutionFolder
project, which is located in the NewFolder
solution folder.
msbuild SlnFolders.sln /t:NotInSlnfolder:Rebuild;NewFolder\InSolutionFolder:Clean
Command-Line Reference
MSBuild Reference
MSBuild
MSBuild Concepts
Please sign in to use this experience.
Sign in