我正在尝试询问的版本。NET核心,我的web应用程序是用它编译的。该应用程序部署在带有Linux 4.9.28-v7+armv7l的Raspberry Pi 2上。看不到明显的方法。
这可能吗?
您可以使用以下代码段:
var framework = Assembly
.GetEntryAssembly()?
.GetCustomAttribute<TargetFrameworkAttribute>()?
.FrameworkName;
var stats = new
{
OsPlatform = System.Runtime.InteropServices.RuntimeInformation.OSDescription,
AspDotnetVersion = framework
};
代码位于:weblog.west-wind.com
当在我的电脑上运行时,它会返回:
Microsoft Windows 10.0.17134
.NETCoreApp,Version=v2.1