Specifying the msbuild configuration for a Delphi project on the commandline

Starting with Delphi 2007 EmBorCodera switched to msbuild for the build system. The newly introduced .dproj file used since then is a valid build script for msbuild but unfortunately the format has changed between Delphi 2007 and 2009. This means that there is a difference if you want to make command line builds and specify the build configuration:

With Delphi 2007, you use:

msbuild /target:rebuild /p:Configuration=Release %dprname%

You might also want to add the -p:DCC_Quiet=true option to reduce the amount of empty lines output:

msbuild /target:rebuild /p:Configuration=Release -p:DCC_Quiet=true %dprname%

With Delphi 2009 and later, you use:

msbuild /target:rebuild /p:config=Release %dprname%

(Source: This answer on StackOverflow.)

Until today I wasn’t aware of this difference so my automated GExperts builds for Delphi 2007 always used the build configuration that was selected in the IDE, which probably means that I have released debug builds rather than release builds for that Delphi version.