Closed smabuk closed 3 years ago
There are a few ways that this can be achieved, but this is the simplified version I'm using for Blazor projects.
I would normally include a full code block in the csproj a bit like this
<PropertyGroup> <Authors>Simon Brookes</Authors> <Company>Simon Brookes</Company> <Copyright>Copyright © Simon Brookes</Copyright> <Description></Description> <VersionPrefix>0.8.20</VersionPrefix> <VersionSuffix Condition=" '$(ComputerName)' != '' ">$(ComputerName)-$([System.DateTime]::get_Now().get_Year())$([System.DateTime]::get_Now().get_Month().ToString("D2"))$([System.DateTime]::get_Now().get_Day().ToString("D2"))-$([System.DateTime]::get_Now().get_Hour().ToString("D2"))$([System.DateTime]::get_Now().get_Minute().ToString("D2"))</VersionSuffix> <VersionSuffix Condition=" '$(ComputerName)' == '' ">$([System.DateTime]::get_Now().get_Year())$([System.DateTime]::get_Now().get_Month().ToString("D2"))$([System.DateTime]::get_Now().get_Day().ToString("D2"))-$([System.DateTime]::get_Now().get_Hour().ToString("D2"))$([System.DateTime]::get_Now().get_Minute().ToString("D2"))</VersionSuffix> </PropertyGroup>
If you want to see the sort of thing that can be done with MSBuild and versioning I made a sample repository about 4 years ago when I was still primarily working in VB.NET.
Versioning Demos
What it does
Background
There are a few ways that this can be achieved, but this is the simplified version I'm using for Blazor projects.
I would normally include a full code block in the csproj a bit like this
If you want to see the sort of thing that can be done with MSBuild and versioning I made a sample repository about 4 years ago when I was still primarily working in VB.NET.
Versioning Demos