如何从Runtime中获取当前.NET Core的版本

2019-02-18 17:44发布

问题:

使用

System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription

获取到的内容为 .NET Core 4.6.27317.07 ,这个是什么鬼啊。
怎么从RunTime中获取到像下面这样的

除了从csporj文件中提取配置,或者是从Assembly 中获取到配置

回答1:

corefx 目前没有 api 可以准确获取 .net core 的版本,详见 Get the .NET Core version number at runtime

除了你不考虑的2个方法,还可以通过在程序中执行 dotnet --info 命令获取



标签: .net-core c#