Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Breaking Change] Improving .NET Core Version APIs #28788

Closed
richlander opened this issue Feb 25, 2019 · 3 comments
Closed

[Breaking Change] Improving .NET Core Version APIs #28788

richlander opened this issue Feb 25, 2019 · 3 comments
Labels
area-System.Runtime breaking-change Issue or PR that represents a breaking API or functional change over a prerelease.
Milestone

Comments

@richlander
Copy link
Member

[Breaking Change] Improving .NET Core Version APIs

We are improving the .NET Core version APIs in .NET Core 3.0. The particular changes we made are technically breaking. The changes are currently only in the master branch, so will be part of .NET Core 3.0 Preview 4, modulo feedback.

Also posted at dotnet/coreclr dotnet/runtime#23011

Related:

Goal

The goal of the improvement is to enable access to accurate and precise product version information, like is displayed in the following example:

C:\testapps\versioninfo>dotnet run
.NET Core version:
Environment.Version: 3.0.0
RuntimeInformation.FrameworkDescription: .NET Core 3.0.0-preview4.19113.15
CoreFX Build: 3.0.0-preview4.19113.15
CoreFX Hash: add4cacbfb7f7d3f5f07630d10b24e38da4ad027

Code: https://gist.github.com/richlander/f5849c6967c66d699301f75101906f99

Existing Behavior

The product (as of .NET Core 3.0 Preview 3) does not provide the version information displayed above, but seemingly arbitrary values, as displayed in the following example (using the same code):

C:\testapps\versioninfo>dotnet run
.NET Core version:
Environment.Version: 4.0.30319.42000
RuntimeInformation.FrameworkDescription: .NET Core 4.6.27415.71
CoreFX Build: 4.7.0-preview4.19113.15
CoreFX Hash: add4cac

Note: These version strings are based on the .NET Framework heritage of the product.

Breaking Change

The change is technically breaking because it resets the versioning scheme of the product as reported by these APIs. Some code somewhere will break, however, we do not expect that to be pervasive. Unfortunately, it will be hard to write code that works with both the new behavior and old behavior given how close the values are.

We should never have shipped .NET Core 1.0 with this behavior to avoid this problem now. We decided that .NET Core 3.0 is likely our last chance to fix these APIs, so decided to take the opportunity now.

Feedback

We would love your feedback.

@EdiWang
Copy link

EdiWang commented Mar 27, 2019

This is great! I have struggled with getting .NET Core version for a long time.

BTW, could we have a label "Breaking Change" to help track these issues? It would be helpful after .NET Core 3.0 release and we can see what could break when retargeting 2.x code to 3.0.

@richlander
Copy link
Member Author

I added the label for you. Good idea.

I am closing this issue now. The change is in .NET Core 3.0 Preview 4.

@karelz
Copy link
Member

karelz commented Jun 5, 2019

I don't think this label is that useful, unless we have process to use it. I recommend to keep an MD file with list of breaking changes, given that we have so few.
Deleting the label, to keep some sanity in number of labels we have (which is already way too high :()

@msftgits msftgits transferred this issue from dotnet/corefx Feb 1, 2020
@msftgits msftgits added this to the 3.0 milestone Feb 1, 2020
@richlander richlander added the breaking-change Issue or PR that represents a breaking API or functional change over a prerelease. label Jun 9, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Runtime breaking-change Issue or PR that represents a breaking API or functional change over a prerelease.
Projects
None yet
Development

No branches or pull requests

4 participants