Building vcproj-Files with msbuild

If you want to batch-build VC++ projects you can either use devenv or msbuild.
msbuild has many option in which you can change and log the build process.

Here is just a example of a simple .proj-template for starting of batch-builds with msbuild:

 
   
     
     
     
   
   
     
     
   
   
     
     
   
   
     
     
   

You need just to save this file with the extension .proj” and call “msbuild” from the same directory. It will then do a “Rebuild” (see “DefaultTargets”).
Or you can do a “Clean” with “msbuild /t:Clean”.
You can also log to a file with “msbuild /v:d /fileLogger”.
Also, if you do not need a specific build-order of your projects, you can just include every vcproj-File in your subfolders by changing

   
     
     
     
   

to

   
     
   

Also, msbuild returns 0 if the build was sucessfull, otherwise “1”. So you can determine the result of the build in your batch-files.

So you can see: msbuild is very powerfull…

1 thought on “Building vcproj-Files with msbuild

  1. Morris Maynard

    %MSB% BLAT01.proj /t:Build
    Microsoft (R) Build Engine Version 3.5.30729.4926
    [Microsoft .NET Framework, Version 2.0.50727.4952]
    Copyright (C) Microsoft Corporation 2007. All rights reserved.

    Build started 11/30/2010 10:52:33 AM.
    Project “BLAT01.proj” on node 0 (Build target(s)).
    BLAT01.proj(37,5): error MSB3411: Could not load the Visual C++ component “VCBuild.exe”. If the component is not installed, eith
    er 1) install the Microsoft Windows SDK for Windows Server 2008 and .NET Framework 3.5, or 2) install Microsoft Visual Studio 2008.
    Done Building Project “BLAT01.proj” (Build target(s)) — FAILED.

    Build FAILED.

    “BLAT01.proj” (Build target) (1) ->
    (Build target) ->
    BLAT01.proj(37,5): error MSB3411: Could not load the Visual C++ component “VCBuild.exe”. If the component is not installed, ei
    ther 1) install the Microsoft Windows SDK for Windows Server 2008 and .NET Framework 3.5, or 2) install Microsoft Visual Studio 2008.

    0 Warning(s)
    1 Error(s)

    Time Elapsed 00:00:00.05

Comments are closed.