4

I'm packing my nuget package using dotnet pack command and before update my projects to dotnet core 1.1.2 and vs2017 I was able to put version of package with 4 numbers according our internal conventions (YEAR.RELEASE.PATCH.BUILD - 2017.02.01.123456).

After updating build number is always ignored and I can put it only in version suffix and this is not acceptable because nuget packages with version suffix is interpreted as prerelease.

How can I generate nuget package with 4 numbers in version?

My command is:

dotnet pack "MyProject.csproj" -c Release -o ..\Build\Packages /p:Version="$build_version-b$build_nr" --include-symbols
Dumitru
  • 833
  • 3
  • 12
  • 26

1 Answers1

1

Using 4-part version numbers is still possible with the new .NET Core tooling, though you might hit limits in the version number support of .NET and NuGet: The limit of each component is 65534 - so 123456 is simply too high.

using

dotnet pack /p:Version=2017.02.01.12345

produces an mylib.2017.2.1.12345.nupkg as expected.

Martin Ullrich
  • 94,744
  • 25
  • 252
  • 217