Usage:
C:\> CSBuild.exe [target] [/p:name=value] [/group=name1,name2] [/config=path\to\csbuild.config] [/log=logfile.txt] [/quiet] [/verbose] [/verbosity={Level}]
CSBuild is an MSBuild automation project to solve several key issues with using MSBuild directly. The following outlines some of the goals that CSBuild attempts to resolve:
Benefits of CSBuild
- No more 'master' solutions - CSBuild takes an entire source tree worth of projects and builds them in the right order.
- No more 'dead' projects - projects that have been removed from the aforementioned master solution that no longer build :( CSBuild keeps every project building.
- Forced project options - controlling project options like output directories, target frameworks, etc takes a mother-load of a command-line in MSBuild.
- Use specific assemblies - MSBuild does not allow you to easily control what assemblies are used in your build, thus a 2.0 build suddenly relies on a 3.5-only API like WaitHandle.WaitOne(0).
- 2008 projects don't work - Using MSBuild from the Framework 2.0 directory will fail to build projects created in Visual Studio 2008 and later, CSBuild works.
- MSBuild syntax sucks - controlling properties on the command-line every time you build just stinks, it's not enough to just give it a project/solution you have to specify more information. With CSBuild you have only to type the word "csbuild", press enter, and away you go...
Options:
- target Targets are specified on the command line without a preceding switch. You may specify any number of targets, each as their own argument. All projects must support all the targets specified or MsBuild will fail.
- /p:name=value properties can be defined just as you would when using MSBuild.exe directly (see below).
- /group=name1,name2 specifies one or more names of configuration target groups to build.
- /config=path\to\csbuild.config path to the configuration file to use (relative to cwd) instead of using CSBuild.exe.config.
- /log=logfile.txt overrides the path to log file to write (relative to cwd).
- /quiet produces console output only on errors and warnings.
- /verbose produces verbose console output.
- /verbosity={Level} where {Level} is one of the MsBuild defined verbosity levels: Quiet, Minimal, Normal, Detailed, Diagnostic.
- /wait after processing wait for user input before exiting the process.
MSBuild Properties:
Properties can be defined that are passed directly to MsBuild. You can use multiple property definitions as needed.
Examples:
/p:name=value -p=name:value /property:name=value -property=name:value
Common Properties:
/p:Platform:AnyCPU /p:Configuration=Release /p:OutputPath=Release\AnyCPU\v3.5 /p:TargetFrameworkVersion=v3.5 /p:FrameworkBinPathv35=%windir%\Microsoft.NET\Framework\v3.5
Common Targets:
- build Runs the build target on all projects. This is also the default target when one is not specified.
- clean Runs the clean target on all projects.
- rebuild Rebuilds all projects.
- [other] Any MsBuild target supported by the projects included.