asp.net-core - 如何获取有关运行时 .Net Core 的信息

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

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

最佳答案

您可能正在寻找 System.Runtime.InteropServices.RuntimeInformationIsOsPlatform函数进行运行时检查。

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

关于asp.net-core - 如何获取有关运行时 .Net Core 的信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39207282/

相关文章:

assemblies - 将程序集添加到 Visual Studio 2015 ASP.NET 5

webpack - 将 webpack 与 dotnet run 捆绑在一起

c# - Azure Active Directory 抛出 "Not implemented"用于 api 管理灾难恢复

dependency-injection - .Net 核心 : Custom scope for "Scoped" Dependency injection w. 输出。 Controller

asp.net-mvc - asp.net core mvc cors 请求被拒绝

c# - 有效锁定资源,由字符串标识

nservicebus - 在 MVC 6 中配置 NServiceBus 总线实例

asp.net-core - 无法为 'Model' 创建 DbSet,因为此类型未包含在上下文的模型中

c# - 如何从 T 的类型中获取 T 的类型?

asp.net-core-mvc - 为 dotnet core asp.net 运行 CRUD 脚手架时出错