首页 > 代码库 > 获取 .net framework 路径

获取 .net framework 路径

要获取当前程序所使用的.netframework路径:

System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory();

 

要获取某个指定版本.netframework路径:

引入 Microsoft.Build.Utilities.dllMicrosoft.Build.Utilities.ToolLocationHelper.GetPathToDotNetFramework(Microsoft.Build.Utilities.TargetDotNetFrameworkVersion.Version40); //4.0版本Microsoft.Build.Utilities.ToolLocationHelper.GetPathToDotNetFramework(Microsoft.Build.Utilities.TargetDotNetFrameworkVersion.LastVersion); //当前机器最新版本

 

 

获取 .net framework 路径