TLDR: Where is dotnet pack
pulling the version information when it creates the nuget package for an assembly?
I have a library, that I had transitioned fr
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:
1.0.0
alpha
You can also use the single Version
property, but the docs warn that this "may override version settings during packaging".
1.0.0-alpha