使用 Create an offline installer for Visual Studio 2017 , Use command-line parameters to install Visual Studio 2017和 Visual Studio Enterprise 2017 component directory我厌倦了为 Visual Studio 2017, Enterprise
创建离线安装程序
,我第一次使用以下内容:
vs_enterprise.exe --layout --lang en-US --add Microsoft.VisualStudio.Workload.CoreEditor Microsoft.VisualStudio.Workload.NetCoreTools Microsoft.VisualStudio.Workload.NetCrossPlat Microsoft.VisualStudio.Workload.NetWeb 微软.VisualStudio.Workload.WebCrossPlat Microsoft.VisualStudio.Workload.Node
及其工作,我可以成功安装 VS。
在那之后我厌倦了更新创建的文件并向一些workload
添加Recommended/Optional
组件,所以我按照提到的文章,文章说添加 - -includeRecommended
(也 --includeOptional
)开关,安装程序将下载推荐
(可选
) 组件。所以我添加了(例如)--includeRecommended
这样的开关:
vs_enterprise.exe --layout --lang en-US --includeRecommended --includeOptional --add Microsoft.VisualStudio.Workload.CoreEditor Microsoft.VisualStudio.Workload.NetCoreTools Microsoft.VisualStudio.Workload.NetCrossPlat 微软。 VisualStudio.Workload.NetWeb Microsoft.VisualStudio.Workload.WebCrossPlat Microsoft.VisualStudio.Workload.Node
,并且不起作用(第二个cmd(显示下载进度)立即关闭),总而言之,我也厌倦了遵循命令,而且它们都不起作用:
vs_enterprise.exe --layout --lang en-US --add Microsoft.VisualStudio.Workload.NetCoreTools --includeRecommended
vs_enterprise.exe --layout --lang en-US --includeRecommended --add Microsoft.VisualStudio.Workload.NetCoreTools
- ...(我的意思是我更改了所有参数的顺序,实际上我厌倦了所有可能的选项)
我也厌倦了新的(空的)文件夹,但没有成功。
我用谷歌搜索,但我一无所获,只有一些已经存在于 http://learn.microsoft.com 中的示例.
我应该如何使用 includeRecommended/includeOptional
开关?
最佳答案
更新(2021-11-10)
以下解决方案非常适合 Visual Studio 2022
更新
这是所有可用工作负载的列表(链接到它们的详细信息)和使用示例:
- 工作负载
ID
- Visual Studio core editor
Microsoft.VisualStudio.Workload.CoreEditor
- Azure development
Microsoft.VisualStudio.Workload.Azure
- Data storage and processing
Microsoft.VisualStudio.Workload.Data
- Data science and analytical applications
Microsoft.VisualStudio.Workload.DataScience
- .NET desktop development
Microsoft.VisualStudio.Workload.ManagedDesktop
- Game development with Unity
Microsoft.VisualStudio.Workload.ManagedGame
- Linux development with C++
Microsoft.VisualStudio.Workload.NativeCrossPlat
- Desktop development with C++
Microsoft.VisualStudio.Workload.NativeDesktop
- Game development with C++
Microsoft.VisualStudio.Workload.NativeGame
- Mobile development with C++
Microsoft.VisualStudio.Workload.NativeMobile
- .NET Core cross-platform development
Microsoft.VisualStudio.Workload.NetCoreTools
- Mobile development with .NET
Microsoft.VisualStudio.Workload.NetCrossPlat
- ASP.NET and web development
Microsoft.VisualStudio.Workload.NetWeb
- Node.js development
Microsoft.VisualStudio.Workload.Node
- Office/SharePoint development
Microsoft.VisualStudio.Workload.Office
- Python development
Microsoft.VisualStudio.Workload.Python
- Universal Windows Platform development
Microsoft.VisualStudio.Workload.Universal
- Visual Studio extension development
Microsoft.VisualStudio.Workload.VisualStudioExtension
- Unaffiliated components
创建离线安装程序:Documentation for VS2019/Documentation For VS2022
- 下载 Visual Studio Bootstrap (例如:
vs_enterprise.exe
) - 创建本地安装缓存
- 例如:
D:\whatever\vs_enterprise.exe --layout d:\whatever --add Microsoft.VisualStudio.Workload.CoreEditor --add Microsoft.VisualStudio.Workload.NetCoreTools --lang en-US
- 双击
vs_enterprise.exe
从本地缓存安装 Visual Studio
如果你想更新上一个。创建本地缓存,运行 vs_enterprise.exe --layout d:\whatever
原始答案:
安装程序有一个关于此问题的错误,正如团队所说,该错误已在 v15.1
(发布日期:4/6/2017)中修复。
我可以使用以下命令成功下载 Microsoft.VisualStudio.Workload.NetWeb
工作负载。 (1.79GB)
vs_enterprise.exe --layout --lang en-US --add Microsoft.VisualStudio.Workload.NetWeb --includeRecommended --includeOptional
关于visual-studio-2017 - 为 Visual Studio 创建离线安装程序,includeRecommended/includeOptional 开关不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43012961/