This question is very similar to Setting the version number for .NET Core projects, but not the same. Using the latest stable version of .NET Core at the time of writing (1.
For those looking for a different automated (CI) way to do this, consider using conditionals in the .csproj file based on environment variables. For example, you might normally have a hardcoded version prefix and a timestamp-based suffix. But for proper releases, you would want to replace both with a single version that you set during the CI build. To do this, you can set an environment variable before calling dotnet build: let's say, RELEASE_VERSION.
In the .csproj file, under a , you would have the following:
$(RELEASE_VERSION)
0.0.1
$([System.DateTime]::UtcNow.ToString(`yyyyMMdd-HHmm`))
The conditions above are set up such that, if the environment variable RELEASE_VERSION is empty, the normal prefix and suffix tags are used. But if it's not empty, then the signular version tag is used instead.