VS2019离线安装
1、下载 Visual Studio 引导程序(必须联网下载)
版本 | 文件 |
---|---|
Visual Studio社区 | vs_community.exe |
Visual Studio专业版 | vs_professional.exe |
Visual Studio企业 | vs_enterprise.exe |
Visual Studio生成工具 | vs_buildtools.exe |
2、添加环境变量
将引导程序路径添加至环境变量
3、创建本地安装缓存(必须联网下载)
下载离线安装包到d:\vs2019
-
对于.NET Web和.NET桌面开发,
vs_enterprise.exe --layout d:\vs2019 --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.NetWeb --add Component.GitHub.VisualStudio --includeOptional --lang zh-CN -
对于.NET桌面和Office开发
vs_enterprise.exe --layout d:\vs2019 --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.Office --includeOptional --lang zh-CN -
对于C ++桌面开发
vs_enterprise.exe --layout d:\vs2019 --add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --lang zh-CN -
要创建具有所有功能的完整本地安装(这将花费很长时间,至少需要35GB的磁盘空间)
vs_enterprise.exe --layout d:\vs2019 --lang zh-CN
或
vs_enterprise.exe --layout d:\vs2019 --all --includeRecommended --includeOptional --lang zh-CN -
离线安装包常用组件
vs_enterprise.exe --layout d:\vs2019 --add Microsoft.VisualStudio.Workload.Azure --add Microsoft.VisualStudio.Workload.NetWeb --add Microsoft.VisualStudio.Workload.NetCoreTools --add Component.GitHub.VisualStudio --add Microsoft.Component.HelpViewer --add Microsoft.VisualStudio.Component.LinqToSql --includeOptional --lang zh-CN
3、从本地缓存安装 Visual Studio
命令安装
d:\vs2019\vs_enterprise.exe --noweb --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.NetWeb --add Component.GitHub.VisualStudio --includeOptional
参数介绍:
参数 | 值 |
---|---|
--layout | 安装文件的下载路径,例如:d:\vs2019 |
--lang | 语言包。例如需要中文版,则输入参数: --lang cn-ZH |
语言编号 | 语言 |
---|---|
en-US | 英文 |
zh-CN | 中文简体 |
![](https://image.shishitao.com:8440/aHR0cHM6Ly9pbWcyMDIwLmNuYmxvZ3MuY29tL2Jsb2cvMzU2OTUvMjAyMTA4LzM1Njk1LTIwMjEwODE3MTMxMzQ2ODAyLTkzMDExMzA5MC5qcGc%3D.jpg?w=700&webp=1)