最近工作遇到一个问题 关于.NET Framework Targeting Pack4.7 binary 编译产出能否在.NET Framework 4.5上运行。于是开始补background
.NET Framework:
运行环境,仅用于运行程序。
在win8以及之后的版本,都不允许卸载.net,它自带安装的版本可以通过查看注册表的方式确定 Determine which .NET Framework versions are installed - .NET Framework | Microsoft LearnHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full folder
如果实在想试试,可以去win7里把net framework卸载了,你会发现很多exe都不能doubleclick了。VS安装setup,sqlserver安装setup,全都run不起来,报错 如图
.NET Framework Developer Pack
A developer pack includes a specific version of .NET Framework and its accompanying SDK along with its corresponding targeting pack.
翻译:一个开发包比如4.8,它包含了.Net FrameWork 4.8,targeting pack 4.8,以及附带的SDK。更多的是一个大礼包
.NET Framework Targeting Pack
-
visual studio使用的,用于编译等开发工作
A targeting pack lets your app target a specific version of .NET Framework when developing in Visual Studio and some other development environments.
翻译过来就是 .NET Framework Targeting Pack比方说4.7.2可以让你在VS或者其他开发环境当中,在开发编译的时候指向你想要的 .NET Framework 4.7.2
当你打开VS想要使用C#编译一个ConsoleApp的时候,你必须先下载。
那你编译的产出就会变成这样