我想为MacOS和Windows设置不同的应用程序。我如何从Startup类中检索运行我的应用程序的操作系统以加载正确的appsettings.json?
答案 0 :(得分:3)
public Startup(
IConfiguration configuration,
IHostingEnvironment env
)
{
var os = RuntimeInformation.OSDescription + " " + RuntimeInformation.OSArchitecture.ToString();
}