Package version is always 1.0.0 with dotnet pack

2021-02-08 07:17

阅读:431

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


评论


亲,登录后才可以留言!