vs_buildtools.exe --layout C:\vs2022_buildtools_offline ^ --add Microsoft.VisualStudio.Workload.VCTools ^ --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 ^ --add Microsoft.VisualStudio.Component.Windows10SDK.20348 ^ --lang en-US
For enterprise build farms, offline layouts are the gold standard. Here is a complete PowerShell script to create, verify, and deploy an offline layout. visual studio build tools 2022 offline installer
vs_buildtools.exe --layout C:\vs2022_buildtools_offline ^ --add Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools ^ --add Microsoft.VisualStudio.Workload.MSBuildTools ^ --lang en-US vs_buildtools
vs_buildtools.exe --layout C:\vs2022_buildtools_offline --lang en-US This downloads all available Build Tools workloads and components for English (en-US). It will take a long time (10–100+ GB) and considerable bandwidth. To save space and time, specify only the workloads you actually need. Use --add to include workloads or individual components. It will take a long time (10–100+ GB)
C:\vs2022_layouts\ 2024-Q1\ 2024-Q2\ 2024-Q3\ Then update your build agent provisioning scripts to point to the latest frozen version. To reproduce the exact same layout on another machine or for documentation:
C:\layout\vs_buildtools.exe --quiet --wait --norestart --installPath C:\BuildTools Add --add parameters as needed. Create a Dockerfile that copies the layout and installs: