Package version is always 1.0.0 with dotnet pack

后端 未结 3 1573
小鲜肉
小鲜肉 2021-02-02 05:31

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

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-02 06:01

    NOTE: I understand this question is not specifically about VSTS/Azure Dev Ops but a search for how to do this on a build pipeline lands here so adding what worked for me

    1. Use the dotnet core task
    2. Tools version 2.*
    3. Command = custom
    4. Custom Command = pack
    5. Arguments = -p:Version=1.0.$(Build.BuildId) -o $(Build.ArtifactStagingDirectory)

    The -o argument is required if the task following the packaging is going to push to a feed (isn't that why one would build packages?)

提交回复
热议问题