Make dotnet pack usage more CI / build system friendly
See original GitHub issueSteps to reproduce
Assume, that have a project.json with a version placeholder (e.g. 1.0.0). It would be nice, if there would be a way for a CI system (like TeamCity) to update this version number without requiring the usage of regular expressions.
Expected behavior
One or more of the following:
- Support for
$version$
asversion
value. - Support for
--version
parameter
The $version$
would get replaced by the version of the AssemblyInformationalVersionAttribute
or (when the former is missing), the value of the AssemblyVersionAttribute
. The --version
parameter would enforce the usage of the given version (and thus overriding the found assembly version).
Actual behavior
dotnet pack
uses the version from the project.json
and the CI system (like TeamCity) must patch the project.json
, which is error prone, because it must not update the version
values of dependencies.
Environment data
dotnet --info
output:
.NET Command Line Tools (1.0.0-rc2-002485)
Product Information:
Version: 1.0.0-rc2-002485
Commit Sha: d3c65aee87
Runtime Environment:
OS Name: Windows
OS Version: 10.0.10586
OS Platform: Windows
RID: win10-x64
Issue Analytics
- State:
- Created 7 years ago
- Reactions:11
- Comments:18 (7 by maintainers)
There is no point in investing in dotnet pack. We are retiring it right after rc in favor of nuget pack
@ardalis You could introduce an msbuild property for your build number as such: