【发布时间】:2016-08-29 13:15:47
【问题描述】:
我有一个适用于 Linux 和 Windows 的应用程序。我需要知道应用程序在哪里工作以使用差异代码。谢谢
【问题讨论】:
-
尝试使用
RuntimeInformationfromSystem.Runtime.InteropServices:RuntimeInformation.IsOSPlatform(OSPlatform.Linux)orRuntimeInformation.IsOSPlatform(OSPlatform.Windows)orRuntimeInformation.IsOSPlatform(OSPlatform.OSX)
标签: asp.net-core asp.net-core-mvc .net-core asp.net-core-1.0 .net-core-rc2