Core: How do you pass a patch number into dotnet build and dotnet pack?

Created on 9 Oct 2017  路  2Comments  路  Source: dotnet/core

Hi. I'm new to dotnet core, and I need the build system to generate a patch number when running dotnet build and dotnet pack, so that the assembly version, assembly file version and nuget package version are all the same. E.g. dotnet build --version 1.0.1251923.

Is this possible? So far I've only seen the number having to be entered by hand in the project file using <Version>1.0.123</Version>.

Thanks for any help!

Most helpful comment

Version is an MSBuild property, so you can specify it using the /p: syntax. E.g.:

dotnet build /p:Version=1.0.123

Though 1.0.1251923 is not a valid version.

All 2 comments

Version is an MSBuild property, so you can specify it using the /p: syntax. E.g.:

dotnet build /p:Version=1.0.123

Though 1.0.1251923 is not a valid version.

Closing because @svick is correct. It can be passed in on the command line.

Was this page helpful?
0 / 5 - 0 ratings