Official tutorial download and installation steps
Create a local layout using the command line
Download the bootstrap program for the required version of Visual Studio and copy it to the directory that you want to use as the local layout source location. Once you have created the layout, you can use it to install Visual Studio. Bootstrap is an executable file used to create, update, and perform other Visual Studio installation operations. An Internet connection is required to complete this operation.
Step 1 - Download the Visual Studio Bootstrap
Download address: https://learn.microsoft.com/zh-cn/visualstudio/install/create-an-offline-installation-of-visual-studio?view=vs-2022#step-1—download-the-visual -studio-bootstrapper
selects the community version for download.
Step 2 - Create local layout
An Internet connection is required to complete this step.
Open a command prompt using Pipe 理员权限
, navigate to the directory where you downloaded Bootstrap, and create a local layout using the Bootstrap parameters defined in the Install Visual Studio Using Command Line Parameters page. Common examples of using the Enterprise bootstrap are described below and on the Command Line Parameters Examples page. You can install languages other than English by changing to the en-US locale from the language locale list, and you can further customize the local layout using the components and workloads list.
hint
To prevent errors, make sure the full installation path is less than 80 characters long.
1. For .NET Web and .NET Desktop development, run:
vs_Community.exe --layout d:\vs2022--add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.NetWeb --includeOptional --lang en-US
The meanings of the appeal order parameters are as follows:
--layout 位置
: Specify the offline package to the specified location
--add 工作负载
: Add a workload, the corresponding workload ID will be listed below. To download multiple workload components, you can add several more –add parameters.
--includeOptional/--includeRecommended
: Install recommended items in the selected workload group/Install all optional items in the selected workload
--lang 语言
: Install the language pack, a list of languages will be given below
For a list of commonly used workload IDs, you can go to the official website to view the complete list. Here is a part of the community version:
workload | Corresponding id |
---|---|
Visual Studio Core Editor | Microsoft.VisualStudio.Workload.CoreEditor |
.NET Desktop Development | Microsoft.VisualStudio.Workload.ManagedDesktop |
Desktop development using C++ | Microsoft.VisualStudio.Workload.NativeDesktop |
Mobile development using C++ | Microsoft.VisualStudio.Workload.NativeMobile |
Mobile development using .NET | Microsoft.VisualStudio.Workload.NetCrossPlat |
ASP.NET and Web Development | Microsoft.VisualStudio.Workload.NetWeb |
Universal Windows platform development | Microsoft.VisualStudio.Workload.Universal |
Visual Studio extension development | Microsoft.VisualStudio.Workload.VisualStudioExtension |
.NET Core cross-platform development | Microsoft.VisualStudio.Workload.NetCoreTools |
Game development using C++ | Microsoft.VisualStudio.Workload.NativeGame |
2. For .NET desktop and Office development, run:
vs_Community.exe --layout d:\vs2022 --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.Office --includeOptional --lang en-US
3. For C++ desktop development, run:
vs_Community.exe --layout d:\vs2022 --add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --lang en-US
4. To create a complete local layout (English, Chinese), with all features (this takes a long time - there are a lot of features!), run:
vs_Community.exe --layout d:\vs2022 --lang en-US zh-CN
5. To ensure that the installer does not attempt to access the Internet when installing the product, use --noweb
the switch.
vs_Community.exe --noweb --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.NetWeb --includeOptional
The final file will be downloaded to the directory you specify, and can be compressed with compression software for offline installation!
Step 3
Change the offline package directoryvs_community.exeandvs_setup.exeFile properties, because the default installation environment of vs2019 is win10, you need to change it to win7 at this time, as follows:
Enter the offline package download directory we specified above and you will see a vs_setup.exe
file in it. Open cmd and use the cd command to enter the offline package download directory and call vs_setup.exe
the file.
The offline installation command format is as follows:
vs_setup.exe --noweb --add 工作负载 --includeOptional/--includeRecommended
The working components and recommended components for installation or the option parameters of all optional components here --add
need to be the same as the command line options used in the above offline download;
eg: I downloaded the offline package of the recommended components in the .NET desktop development workload, then the command to start the offline installation:
vs_setup.exe --noweb --add Microsoft.VisualStudio.Workload.ManagedDesktop --includeRecommended
After installation, the following interface will appear, then click Install! ! !
Remark
If you encounter an invalid signature error, you must install an updated certificate. Open the Certificates folder in local layout. Double-click each certificate file, and then click Complete Certificate Manager Wizard. If asked for a password, leave it blank.
If you use Visual Studio Community, you may be prompted to log in for 30 days after installation, but this will not affect your ability to use the product.
Language locale list
Language-Locale | language |
---|---|
cs-CZ | Czech |
That's the | German |
in US | English |
es-ES | spanish |
fr-FR | French |
it-IT | Italian |
me-JP | Japanese |
ko-KR | Korean |
pl-PL | Polish |
pt-BR | Portuguese - Brazil |
ru-RU | Russian |
tr-TR | turkish |
zh-CN | Simplified Chinese |
zh-TW | traditional Chinese |