dotnet / dotnet/project-system

Not possible to set VersionPrefix for dotnet Standard/Core projects via UI

Open
#3,151 1 comment 4 reactions 0 assignees View on GitHub
Feature-Legacy-Application-Designer Feature-NuGet Feature-Project-Properties-Designer Triage-Approved
Dominant language
C#
Stars
1k
Forks
415
PR merge metrics
No merged PRs in 30d

Description

The "dotnet pack" command line tool allows an optional parameter to specify VersionSuffix which is great for creating pre-release packages for Nuget. This setting however only works if the project file has a VersionPrefix element, and not a Version element as Version always overrides any VersionPrefix.

The issue I have is that there is no way to set the VersionPrefix property via the UI (Project Properties -> Package -> PackageVersion). Manually updating the project file to have a VersionPrefix rather than a Version element works fine, and displays correctly in the Project Properties form, however subsequent edits to the field via the UI results in an unmodified VersionPrefix element, and a newly created Version element which then stops the "dotnet pack" command from applying the VersionSuffix.

Please not that this is a copy of the following issue:
https://developercommunity.visualstudio.com/content/problem/63124/not-possible-to-set-versionprefix-for-dotnet-stand.html
That isssue is reported as closed, but the fix mentioned is totally unrelated to the problem above.

_This issue has been moved from https://developercommunity.visualstudio.com/content/problem/179117/not-possible-to-set-versionprefix-for-dotnet-stand-2.html
VSTS ticketId: 549205_
_These are the original issue comments:_
(no comments)
_These are the original issue solutions:_
(no solutions)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.