Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 517
Serhii Shemshur Avatar asked Aug 29 '16 13:08

Serhii Shemshur


People also ask

How do I check my .NET Core runtime?

You can see both the SDK versions and runtime versions with the command dotnet --info . You'll also get other environmental related information, such as the operating system version and runtime identifier (RID).

Where is .NET runtime located?

NET in the File System. You can check your installed versions of . NET by navigating to Microsoft.NET\Framework under your Windows folders. The complete path is usually 'C:\Windows\Microsoft.NET\Framework.

How does .NET Core runtime work?

NET Core runs on Windows, macOS, and Linux operating systems. There are different runtime for each operating system that executes the code and generates the same output. Consistent across Architectures: Execute the code with the same behavior in different instruction set architectures, including x64, x86, and ARM.


1 Answers

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.

like image 168
Ralf Bönning Avatar answered Sep 20 '22 13:09

Ralf Bönning