dotnet / project-system

The .NET Project System for Visual Studio
MIT License
968 stars 386 forks source link

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

Open vsfeedback opened 6 years ago

vsfeedback commented 6 years ago

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)

owenneil commented 6 years ago

Just hit this myself, it's pretty frustrating because people can easily break it and not notice it at all. This completely overrides the ability to create pre-release packages that are properly versioned.