5

VS2022 安装.NET 3.5/.NET 4/.NET 4.5/.NET 4.5.1目标包的方法 - Dykimy

 2 years ago
source link: https://www.cnblogs.com/Dykimy/p/16051670.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

最近重装了系统,就装了一个Visual Studio 2022,发现之前的老项目打不开了,需要下载目标包,但是在Visual Studio Installer 里面无法安装 .NET 3.5/.NET 4/.NET 4.5/.NET 4.5.1,但是我又不想装Visual Studio 2019。
另辟蹊径,我们从Visual Studio 2019 提取 对应的目标包。

首先安装.NET 3.5

管理员运行 Powershell
dism.exe /online /enable-feature /featurename:NetFX3 /All /LimitAccess
坐等完成。

从VS2019提取并安装 .NET 4/.NET 4.5/.NET 4.5.1 目标包

我已经提取了包上传了Github,下载可以跳过第一步 →直达地址 https://github.com/Delevin888/NetFrameworkTargetPack

  1. 下载 Visual Studio 2019 的安装包,不要急着打开,进入目录。
    .\vs_enterprise.exe --layout c:\vslayout --add Microsoft.Net.4.TargetingPack --add Microsoft.Net.4.5.TargetingPack --add Microsoft.Net.4.5.1.TargetingPack --lang zh-CN
    等待完成。
    如果想提取别的,可以用 --add 提取,对应的可用列表在此
    https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2019

  2. 在 c:\vslayout 找到对应的文件夹进入分别执行命令

c:\vslayout\Microsoft.Net.4.TargetingPack...
netfx_dtp.msi MSIFASTINSTALL=7 EXTUI=1
c:\vslayout\Microsoft.Net.4.5.TargetingPack...
netfx45_dtp.msi MSIFASTINSTALL=7 EXTUI=1
c:\vslayout\Microsoft.Net.4.5.1.TargetingPack...
netfx_451mtpack.msi MSIFASTINSTALL=7 EXTUI=1
重启Visual Studio 2022,搞定,收工。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK