I have an app which works on Linux and Windows. I need to know where the app is working for use difference code. Thanks
How to get information about runtime .Net Core
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.
© 2022 - 2024 — McMap. All rights reserved.
RuntimeInformation
fromSystem.Runtime.InteropServices
:RuntimeInformation.IsOSPlatform(OSPlatform.Linux)
orRuntimeInformation.IsOSPlatform(OSPlatform.Windows)
orRuntimeInformation.IsOSPlatform(OSPlatform.OSX)
– Cranial