Skip to content

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

@WolfyUK

Description

@WolfyUK

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: d881d45

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions