获取本机.NET Framework版本

using System;
using System.Runtime.InteropServices;

namespace ConsoleApp3
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(RuntimeInformation.FrameworkDescription);
        }
    }
}

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net46" />
</packages>
posted @ 2025-02-25 10:12  ChasingDreams  阅读(9)  评论(0)    收藏  举报