Skip to content

Instantly share code, notes, and snippets.

@ttkoma
Last active June 2, 2020 23:14
Show Gist options
  • Save ttkoma/38ba950dd0f92b134c798a63b21f93ab to your computer and use it in GitHub Desktop.
Save ttkoma/38ba950dd0f92b134c798a63b21f93ab to your computer and use it in GitHub Desktop.
Autonumbering version .net core >=3.0
<PropertyGroup Label="Assembly Versioning">
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Build>$([System.DateTime]::Now.Date.Subtract($([System.DateTime]::Parse(`2000-01-01`))).TotalDays)</Build>
<Revision>$([System.Convert]::ToUInt16( $([MSBuild]::Divide($([System.DateTime]::Now.TimeOfDay.TotalSeconds), 2 )) ))</Revision>
<AssemblyVersion>$(VersionMajor).$(VersionMinor).$(Build).$(Revision)</AssemblyVersion>
<FileVersion>$(AssemblyVersion)</FileVersion>
<InformationalVersion>$(AssemblyVersion)-preview</InformationalVersion>
</PropertyGroup>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment