Unable to use <Version> in .csproj with --version-suffix during dotnet pack
See original GitHub issueSteps to reproduce
dotnet new classlib
- Edit .csproj and add
<Version>1.0.0-*</Version>
(see dotnet-pack command) dotnet restore
dotnet pack --version-suffix XXX
Expected behavior
Successfully created package 'Project.1.0.0-XXX.nupkg
Actual behavior
Invalid NuGet version string: '1.0.0-*'
The --version-suffix
value only seems to work when the <Version>
element is not present in the .csproj file. In this case, the expected package is generated.
Environment data
dotnet --info
output:
.NET Command Line Tools (1.0.0-rc4-004771)
Product Information: Version: 1.0.0-rc4-004771 Commit SHA-1 hash: d881d45b75
Runtime Environment: OS Name: Windows OS Version: 10.0.14393 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\1.0.0-rc4-004771
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Unable to use <Version> in .csproj with ...
dotnet pack --help shows the following for the --version-suffix argument: Defines the value for the $(VersionSuffix) property in the project.
Read more >How to use the dotnet-pack --version-suffix with csproj?
I'm trying to use the .net Core tools RC4 dotnet pack command to create a nuget package with a suffix. I can create...
Read more >dotnet pack command - .NET CLI
The dotnet pack command creates NuGet packages for your . ... If you want to use --version-suffix , specify VersionPrefix and not Version...
Read more >Setting assembly and nuget package metadata in .NET Core
If the version contains VersionSuffix then the package is treated as pre-release package. Version property is also used in Microsoft.NET.
Read more >How to put Build Number in nupkg prerelease version from ...
I know it can be possible via dotnet pack argument --version-suffix using continuous integration in tfs. But I want to do it using...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For reference, the logic is defined here.
@WolfyUK the idea is that you don’t specify
<Version>
but<VersionPrefix>1.0.0</…>
and the SDK will then derive theVersion
from how these properties are set.