How to get information about runtime .Net Core
Asked Answered
P

1

5

I have an app which works on Linux and Windows. I need to know where the app is working for use difference code. Thanks

Pigmentation answered 29/8, 2016 at 13:15 Comment(2)
try to use RuntimeInformation from System.Runtime.InteropServices: RuntimeInformation.IsOSPlatform(OSPlatform.Linux) or RuntimeInformation.IsOSPlatform(OSPlatform.Windows) or RuntimeInformation.IsOSPlatform(OSPlatform.OSX)Cranial
See my detailed answer in other threadPinnati
D
5

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.

Disburse answered 29/8, 2016 at 13:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.