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

2019-02-18 18:13发布

使用

System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription

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

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

标签: .net-core c#
1条回答
Viruses.
2楼-- · 2019-02-18 18:37

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

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

查看更多
登录 后发表回答