【问题标题】:How to get information about runtime .Net Core如何获取有关运行时 .Net Core 的信息
【发布时间】:2016-08-29 13:15:47
【问题描述】:

我有一个适用于 Linux 和 Windows 的应用程序。我需要知道应用程序在哪里工作以使用差异代码。谢谢

【问题讨论】:

  • 尝试使用RuntimeInformation from System.Runtime.InteropServices: RuntimeInformation.IsOSPlatform(OSPlatform.Linux) or RuntimeInformation.IsOSPlatform(OSPlatform.Windows) or RuntimeInformation.IsOSPlatform(OSPlatform.OSX)

标签: asp.net-core asp.net-core-mvc .net-core asp.net-core-1.0 .net-core-rc2


【解决方案1】:

您可能正在寻找带有IsOsPlatform 函数的System.Runtime.InteropServices.RuntimeInformation 来进行运行时检查。

请看 ASP.NET Monsters 的视频教程https://channel9.msdn.com/Series/aspnetmonsters/ASPNET-Monsters-Episode-46-Finding-Platform-Information

【讨论】:

    猜你喜欢
    • 2017-11-29
    • 2010-10-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-10
    • 1970-01-01
    相关资源
    最近更新 更多