System.Environment in .NET Core 1.0

2019-01-27 16:36发布

Does anybody knows how to get information about current environment and platform in .NET Core? Currently there are no Environment class in Core library.

enter image description here

1条回答
混吃等死
2楼-- · 2019-01-27 16:45

System.Environment is available in the System.Runtime.Extensions package. Ensure you've referenced that package in your project.json.

{
  "frameworks": {
    "dnxcore50": {
      "dependencies": {
        "System.Runtime.Extensions": "4.0.10-*"
      }
    }
  }
}
查看更多
登录 后发表回答