Using PHP-CLI : Automatic Incrementing of .NET Assembly Build Numbers
This is a PHP script to automatically bump up the build number of a .NET assembly on each build, designed to run from the command line (PHP Cli). I was done in PHP because I needed to use Regular Expressions. The code can be extended to take command line options, OR implemented as a DLL in C# or something.
How to Use:
Add a line to your .NET IDE’s Project Options (I use SharpDevelop 2.0) to run this script as a pre-build command, e.g.
[”C:\wamp\php\php.exe” -f “D:\projects\RentDesk\bump-version.php”]
The MSBuild engine uses relative paths to the comilation directory, so you have to specify the full paths to php.exe and the script file.