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 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).
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With