Environment.Version equivalent in core clr

997 Views Asked by At

The following code is valid for the dnx451 framework but not the dnxcore50

string ver = Environment.Version

This method does not exist:

enter image description here

Is there an equivalent property in the dnxcore50 framework?

Update

as per Victors answer you can use PlatformServices.Default.Runtime eg:

Console.WriteLine("env: {0} {1}", PlatformServices.Default.Runtime.RuntimeType, PlatformServices.Default.Runtime.RuntimeVersion);

output: (on dnx451)

env: Clr 1.0.0-rc1-16231

output: (on dnxcore50)

env: CoreClr 1.0.0-rc1-16231

1

There are 1 best solutions below

4
On BEST ANSWER

You can use the properties in IRuntimeEnvironment to get information about the runtime. The following properties are available:

  • RuntimeType
  • RuntimeArchitecture
  • RuntimeVersion
  • RuntimePath