-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Need consistent way to get Runtime framework version #23160
Comments
I thought we have something like this - at least without the version to distinguish .NET Framework vs. .NET Core. |
@karelz, it'd also need to support Mono, Xamarin iOS, Xamarin Android, etc. Basically, "what am I running on now?" |
|
cc @ericstj |
I do think we're missing a good API for "running TFM". We have one for targeted TFM of application, I've started looking at a lot of this stuff as part of the capabilities API investigation. |
Closing in favor of https://github.com/dotnet/corefx/issues/16629 |
What's the current status of this? The last comment redirects me somewhere and then I got lost, so I came back to this place to ask. I cannot find the precise framework/CLR type and version anywhere today in a .NET Core 3.0 app (which would be the target milestone of this issue). |
https://github.com/dotnet/corefx/issues/35573 explains behavior of the version APIs in 3.0 |
For applications that may run on multiple versions, it can be useful diagnostic info to output (".NET Framework 4.7.1" or ".NET Core App 2.0.1", etc).
As far as I can see, there's no way to do this since
TargetFrameworkAttribute
is not present on eithermscorlib
orSystem.Private.CoreLib
. Putting those on would be very helpful as well. At leastmscorlib
has anAssemblyFileVersion
of4.7.2542.1
. I don't see any such thing on .NET Core app that maps to its "real" version. Instead, .NET Core App 1.0.5 has[assembly: AssemblyFileVersion("4.6.25211.02")]
.The ask is to have a reliable way, at runtime, to get a value that says something like ".NET Framework v4.7.1", ".NET Core App 2.0.1" or "UWP ...".
Possibly related to https://github.com/dotnet/corefx/issues/23063
The text was updated successfully, but these errors were encountered: