question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to use <Version> in .csproj with --version-suffix during dotnet pack

See original GitHub issue

Steps 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:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
dasMullicommented, Feb 13, 2017

For reference, the logic is defined here.

2reactions
dasMullicommented, Feb 13, 2017

@WolfyUK the idea is that you don’t specify <Version> but <VersionPrefix>1.0.0</…> and the SDK will then derive the Version from how these properties are set.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found