I am trying to interrogate the version of the .NET Core that my web app was compiled with. The app is deployed on a Raspberry Pi 2 with Linux 4.9.28-v7+ armv7l. Not seeing an obvious way to do it.
Is this even possible?
I am trying to interrogate the version of the .NET Core that my web app was compiled with. The app is deployed on a Raspberry Pi 2 with Linux 4.9.28-v7+ armv7l. Not seeing an obvious way to do it.
Is this even possible?
You can use the following snippet:
var framework = Assembly
.GetEntryAssembly()?
.GetCustomAttribute<TargetFrameworkAttribute>()?
.FrameworkName;
var stats = new
{
OsPlatform = System.Runtime.InteropServices.RuntimeInformation.OSDescription,
AspDotnetVersion = framework
};
Code found on: weblog.west-wind.com
When run on my pc it returns:
Microsoft Windows 10.0.17134
.NETCoreApp,Version=v2.1