A small tip

Oct 9, 2014 at 1:32 PM
Hi,

Great work on a very easy to use library. I have been trying for a while to work out how best to track assemblies back to their original specific Git commit and it turned out to be very easy indeed.

Adding a line below the original in VersionInfo.base.cs

using System.Reflection;
[assembly: AssemblyVersion("1.0.$REVNUM$.$DIRTY$")]
//add the following
[assembly: AssemblyInformationalVersion("1.0.$REVNUM$.$REVID$")]

means that windows will report the File Version as 1.0.0.0 but the Product Version as 1.0.0.xxxx

With xxxx being your current git commit, it means we get unique sequential versions but the assembly carries with it enough information to get back to the exact source control set.

Nice !
Aug 12, 2015 at 4:26 PM
Edited Aug 12, 2015 at 4:31 PM
It works like a charm indeed... If you have the right configuration.

So for an ASP.NET project on Git with MSBuild Versioning standardly installed via nugget; I edited my csproj file like this :
  <UsingTask TaskName="GitVersionFile" AssemblyFile="bin\MSBuildVersioning.dll" />
  <Target Name="BeforeBuild">
    <GitVersionFile TemplateFile="Properties\VersionInfo.base.cs"
        DestinationFile="Properties\VersionInfo.cs" />
  </Target>
  <Target Name="AfterBuild">
  </Target>
That being said, it means nugget should place the dll somewhere else than there because this might be deployed with the website.