I’ve just released a small open-source MSBuild task to do exactly what you need:
- It puts your Mercurial revision number into your .NET assembly version
- You can tell from the version if an assembly has been compiled with uncommitted changes
- Does not cause unnecessary builds if the revision hasn’t changed
- Not dependent on Windows scripting
- Nothing to install – you just add a small DLL to your solution, and edit some files in your project
http://versioning.codeplex.com