Environment.Version equivalent in core clr

久未见 提交于 2019-12-10 19:22:54

问题


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

string ver = Environment.Version

This method does not exist:

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:


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

  • RuntimeType
  • RuntimeArchitecture
  • RuntimeVersion
  • RuntimePath


来源:https://stackoverflow.com/questions/35145661/environment-version-equivalent-in-core-clr

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!