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.

VersionPrefix and VersionSuffix are misnamed

See original GitHub issue

From @adamralph on April 7, 2017 6:44

Prefix:

a word, letter, or number placed before another.

The value of this property never prefixes the version. That would imply that the version is another string of characters, and the value of this property precedes it. This never happens.

Until I read the documentation, I was surprised to see values of VersionPrefix of the form “1.0.0”, since “1.0.0” is not a prefix to the version. It is the version.

The same argument could be applied to VersionSuffix, depending on the interpretation of “version”. If “1.0.0” is the “version” in “1.0.0-beta1” then it’s true to say that the “version suffix” is “beta1”, but if “1.0.0-beta1” is the “version”, then VersionSuffix is similarly misnamed.


Update:

Based on the comments below, it seems that the general opinion is that “1.0.0-beta1” is the “version”, implying that VersionSuffix is also misnamed. I’m re-titling the issue from “VersionPrefix is misnamed” to “VersionPrefix and VersionSuffix are misnamed”.

Copied from original issue: Microsoft/msbuild#1952

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16 (13 by maintainers)

github_iconTop GitHub Comments

4reactions
nguerreracommented, Apr 26, 2017

We debated this quite a bit in https://github.com/dotnet/sdk/issues/93 and didn’t reach a consensus. I personally favored the single Version property approach as well. Still, we shouldn’t break compatibility with projects that already use the VersionPrefix/VersionSuffix despite their less than perfect names.

The options here seem to be:

  1. Pick better names. To remain compatible, we would have to support old names and new names, which I think would only make the situation even more confusing.

  2. Have only the single Version property. This can’t be done compatibly. In retrospect, I probably should have pushed harder on this before it was too late. However, you are already free to avoid VersionPrefix and VersionSuffix if you dislike them. The examples using only Version should work already.

I’m just not seeing a compelling enough reason to make a breaking change here and I don’t see a non-breaking proposal that adds enough value. I’m closing this because I think the status quo is the least bad option we have.

1reaction
adamralphcommented, May 10, 2017

@nguerrera I hadn’t even noticed that there was a single Version property already. The problem is, I’ve seen people use VersionSuffix alone, redundantly, in place of Version, which illustrates the problem. I.e. if there’s no Version what can VersionSuffix suffix? That scenario should result in an exception being thrown somewhere.

I understand your reluctance to make breaking changes and I can understand the lack of appetite to make any changes to this now. Out of interest, is there any path for deprecation of properties, with or without eventual removal?

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the difference between various MSBuild version ...
Default: VersionPrefix if VersionSuffix is empty. VersionPrefix-VersionSuffix if VersionSuffix is not empty. Note: setting Version explicitly ...
Read more >
Version vs VersionSuffix vs PackageVersion: What do they ...
In this post I look at the various different version numbers you can set for a .NET Core project, such as Version ,...
Read more >
What is the difference between Version, AssemblyVersion ...
Most people only need Version and optionally VersionPrefix/VersionSuffix. Everything else is calculated from those three values, ...
Read more >
NuGet pack and restore as MSBuild targets
Defaults to Version if not set. VersionPrefix, VersionPrefix, empty, Setting PackageVersion overwrites VersionPrefix. VersionSuffix ...
Read more >
net – 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 >

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