This project is read-only.

$TAG$ produces 'the version specified '0.tip.606.1' is invalid

Mar 28, 2011 at 7:07 AM

Hi there,

first of all I want to say thank you! This is a really nice way to combine mercurial versioning and Visual Studio versioning, nice work!

For me using $TAG$ doesn't seem to work though. I am guessing strings are not allowed in version numbers, but since it is in the tokens list I was wondering how you got it working...

Thanks in advance,


May 2, 2011 at 1:19 PM


Yes, the components of a .NET assembly version are 16-bit numbers, so you can't use strings.

Try adding an AssemblyInformationalVersion attribute. The value for this attribute is free text, and it shows up in the properties of your assembly as the "product version".

[assembly: AssemblyVersion("1.0.$REVNUM$.$DIRTY$")]
[assembly: AssemblyInformationalVersion("1.0.$REVNUM$.$DIRTY$ $TAGS$")]

Also, there's nothing restricting you from using tokens in other files. For example, create a BuildInfo class, and set it up the same way with a BuildInfo.base.cs file and something like this:


    public static class BuildInfo
        public static string TagNames
            get { return "$TAGS$"; }

Of course, that doesn't make the tags show up in the properties of your assembly, but you could display the information in your program's About dialog, etc.