Inspired by
- http://stackoverflow.com/questions/25768653/versioning-net-builds/25806365#25806365
- https://intovsts.net/2015/08/24/global-net-versioning-strategy-assemblyinformationalversion/
I set off to create an MsBuild Tasks file that could be imported into csproj files and that calls tf.exe history as command line to get the latest revision on a project folder and embedding in the build assembly version revision number. I did not want this to be hidden in a build server step and I wanted the code to be open if a developer needed to investigate the tasks.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjejAn4bqc4tR77YO4wMyOyDTE4HhWuXTSw8GeSfT0EjVqAnLe_nsPVuSUfYW4eBv3-AynXi0lV5naRMPG7ZxQLDwnyXVOA_cXiyU_ztjlNo2WF5TyELIywRtiNDaUIEyfU5nKxew/s400/internalreporting-csproj.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM7nHnhZWU-SUqY8uyHLI2P2GFQeIberh3bmyRElta53lWE5WlGC-E1rYPKHd9KnGv7WlcgmniuceGnSbfagEXXA-xE8mqCXhpd5Ns7StJSHl1Zu-8jvPcIe3uwilbXU6niFghAA/s400/internalreporting.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBHncvnhUgS_jrqDCOI_vEyXEjSGiVu0QNY5E_4hoZup_DCGDzrPmvnk5YykEHPqkxQ7x_mhnWEWwr1NVlSlh1Q_11qXkq6kYu2cwGLIriBPp7NYVLMSfqJ_xlEaQ6k_dZPaQovA/s400/internalreporting-filedetails.png)
The end result is shared in this Gist:
(Updated with Git support on 2017-07-28)
No comments: