Using Create an offline installer for Visual Studio 2017, Use command-line parameters to install Visual Studio 2017 and Visual Studio Enterprise 2017 component directory I tired to create offline installer for Visual Studio 2017, Enterprise, first time I used following:
vs_enterprise.exe --layout --lang en-US --add Microsoft.VisualStudio.Workload.CoreEditor Microsoft.VisualStudio.Workload.NetCoreTools Microsoft.VisualStudio.Workload.NetCrossPlat Microsoft.VisualStudio.Workload.NetWeb Microsoft.VisualStudio.Workload.WebCrossPlat Microsoft.VisualStudio.Workload.Node and its worked and I could install VS successfully.
After that I tired to update created files and add Recommended/Optional Components to some workloads, so I followed mentioned article, article says by adding --includeRecommended (also --includeOptional) switch, installer will download Recommended (Optional) components too. so I added (for ex.) --includeRecommended switch like this:
vs_enterprise.exe --layout --lang en-US --includeRecommended --includeOptional --add Microsoft.VisualStudio.Workload.CoreEditor Microsoft.VisualStudio.Workload.NetCoreTools Microsoft.VisualStudio.Workload.NetCrossPlat Microsoft.VisualStudio.Workload.NetWeb Microsoft.VisualStudio.Workload.WebCrossPlat Microsoft.VisualStudio.Workload.Node, and doesn't work (the second cmd (that shows download progress) closed immediately), in summary, I tired following commands too, and non of them doesn't work neither:
vs_enterprise.exe --layout --lang en-US --add Microsoft.VisualStudio.Workload.NetCoreTools --includeRecommendedvs_enterprise.exe --layout --lang en-US --includeRecommended --add Microsoft.VisualStudio.Workload.NetCoreToolsAlso I tired in new (empty) folder, but no success.
I googled, but I found nothing, only some example that already exists in http://learn.microsoft.com.
How should I use includeRecommended/includeOptional switches?
Update (2021-11-10)
Following solution works perfectly for Visual Studio 2022
Update
Here is the list of all available workloads (linked to their details) and usage sample:
IDMicrosoft.VisualStudio.Workload.CoreEditorMicrosoft.VisualStudio.Workload.AzureMicrosoft.VisualStudio.Workload.DataMicrosoft.VisualStudio.Workload.DataScienceMicrosoft.VisualStudio.Workload.ManagedDesktopMicrosoft.VisualStudio.Workload.ManagedGameMicrosoft.VisualStudio.Workload.NativeCrossPlatMicrosoft.VisualStudio.Workload.NativeDesktopMicrosoft.VisualStudio.Workload.NativeGameMicrosoft.VisualStudio.Workload.NativeMobileMicrosoft.VisualStudio.Workload.NetCoreToolsMicrosoft.VisualStudio.Workload.NetCrossPlatMicrosoft.VisualStudio.Workload.NetWebMicrosoft.VisualStudio.Workload.NodeMicrosoft.VisualStudio.Workload.OfficeMicrosoft.VisualStudio.Workload.PythonMicrosoft.VisualStudio.Workload.UniversalMicrosoft.VisualStudio.Workload.VisualStudioExtensionCreate an offline installer: Documentation for VS2019 / Documentation For VS2022
vs_enterprise.exe)D:\whatever\vs_enterprise.exe --layout d:\whatever --add Microsoft.VisualStudio.Workload.CoreEditor --add Microsoft.VisualStudio.Workload.NetCoreTools --lang en-USvs_enterprise.exe to install Visual Studio from the local cacheIf you want to update prev. created local cache, run vs_enterprise.exe --layout d:\whatever
Original Answer:
The installer had a bug about this issue & as the team said, the bug fixed in v15.1 (release date: 4/6/2017).
I could download Microsoft.VisualStudio.Workload.NetWeb workload with following command successfully. (1.79GB)
vs_enterprise.exe --layout --lang en-US --add Microsoft.VisualStudio.Workload.NetWeb --includeRecommended --includeOptional