-
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
Why does System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription report .NET Core 4.0.0.0? #17722
Comments
/cc @weshaggard @eerhardt |
The version returned is Initially we had the frameworkdescription just return the stack used, and then ASP.NET had a request to return some version info. There wasn't clear guidelines on what the version should be, runtime or framework or the version in the brand name. And we decided to go with this. |
The discussion in dotnet/corefx#4334 (diff) initially started out with preferring to add the FileVersion, but in dotnet/corefx#5210 (diff) it was replaced by Version because UWP doesn't support the FileVersionInfo stuff. @Priya91 does reading AssemblyInformationalVersion work on UWP? Here's a simple example app: using System;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
namespace ConsoleApplication
{
public class Program
{
public static void Main(string[] args)
{
var objectVersion = typeof(object).GetTypeInfo().Assembly.GetCustomAttributes().OfType<AssemblyInformationalVersionAttribute>().Single().InformationalVersion;
var runtimeinfoVersion = typeof(RuntimeInformation).GetTypeInfo().Assembly.GetCustomAttributes().OfType<AssemblyInformationalVersionAttribute>().Single().InformationalVersion;
Console.WriteLine("object version: " + objectVersion);
Console.WriteLine("RuntimeInformation version: " + runtimeinfoVersion);
}
}
} This prints
... on my .NET Core 1.0 RTM install, which is like 1000x more useful than |
That looks much nicer. Couldn't we make this API implement differently in UWP vs. dotnet.exe host, whether by runtime late-binding or #ifdef, etc. |
I added support for that. |
Small Note: The .NET Core version of S.R.IS.RI gets injected into the compilation even if targeting Mono/.NET due to the netstandard1.1 compatibility. This does not only report ".NETCore,Version=4.0.0.0" as described above but it also produces incorrect output when targeting Mono, since the System.Native.so library has to be provided separately. |
@borgdylan that issue is discussed here: https://github.com/dotnet/corefx/issues/9012. |
Please, could this API still be able to be included when using full framework and mono. Mono is currently tracking net461 i.e netstandard1.4. I have filed a bug against mono asking for .NET 4.6.2 targeting support which allow the use of netstandard1.5 in the future. |
Why the issue is closed? For .NET Core 2.1
|
Reopening for discussion if needed. |
Fixed by dotnet/corefx#35516 |
Why does System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription report .NET Core 4.0.0.0?
/cc @DamianEdwards
The text was updated successfully, but these errors were encountered: