When you use dotnet pack
, the version is pulled from the project definition (previously project.json
, now *.csproj
), not AssemblyInfo.cs
. So, your new workflow will be very similar to what it was with project.json
.
From the project.json to csproj migration docs, you can use the VersionPrefix
and VersionSuffix
properties.
Before:
{
"version": "1.0.0-alpha-*"
}
Now:
<PropertyGroup>
<VersionPrefix>1.0.0</VersionPrefix>
<VersionSuffix>alpha</VersionSuffix>
</PropertyGroup>
You can also use the single Version
property, but the docs warn that this "may override version settings during packaging".
<PropertyGroup>
<Version>1.0.0-alpha</Version>
</PropertyGroup>