Serhii Shemshur
Serhii Shemshur

Reputation: 1343

How to get information about runtime .Net Core

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

Upvotes: 5

Views: 1239

Answers (1)

Ralf Bönning
Ralf Bönning

Reputation: 15405

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.

Upvotes: 5

Related Questions