I have an app which works on Linux and Windows. I need to know where the app is working for use difference code. Thanks
You are probably looking for System.Runtime.InteropServices.RuntimeInformation
with the IsOsPlatform
function to do runtime checks.
Have look at the video tutorial https://channel9.msdn.com/Series/aspnetmonsters/ASPNET-Monsters-Episode-46-Finding-Platform-Information of the ASP.NET Monsters.
来源:https://stackoverflow.com/questions/39207282/how-to-get-information-about-runtime-net-core