📌  相关文章
📜  vs_buildtools.exe --norestart --passive --downloadThenInstall --includeRecommended --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Workload.MSBuildTools - C++ (1)

📅  最后修改于: 2023-12-03 15:21:03.143000             🧑  作者: Mango

Visual Studio Build Tools

The Visual Studio Build Tools is a lightweight alternative to the full Visual Studio IDE, specifically designed for building projects targeting Windows, .NET Framework, and C++. With the Build Tools, you can install just the components you need, saving the disk space and installation time.

To install Build Tools with C++ support, you can run the following command:

vs_buildtools.exe --norestart --passive --downloadThenInstall --includeRecommended --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Workload.MSBuildTools - C++

This command will:

  • --norestart: specify that the installer should not restart the system after installation
  • --passive: specify that the installer should run in an unattended mode, without showing any UI
  • --downloadThenInstall: specify that the installer should first download the required components from the internet, and then install them
  • --includeRecommended: specify that the installer should include the recommended components, in addition to the specified workloads
  • --add Microsoft.VisualStudio.Workload.NativeDesktop: specify that the installer should add the Native Desktop workload, which includes the C++ compiler and tools for building Windows desktop applications
  • --add Microsoft.VisualStudio.Workload.VCTools: specify that the installer should add the Visual C++ Tools workload, which includes additional tools and libraries for C++ development
  • --add Microsoft.VisualStudio.Workload.MSBuildTools: specify that the installer should add the MSBuild Tools workload, which includes tools for building and deploying managed applications

Make sure to replace - C++ with a space, as this is a typo in the original command.

After running the command, the Build Tools will be installed silently, without interrupting your work. You can then use the installed components from the command prompt or from your preferred IDE or editor.

Conclusion

The Visual Studio Build Tools is a convenient way to install the necessary components for building Windows and C++ applications, without installing the full Visual Studio IDE. By running the vs_buildtools.exe command with the appropriate arguments, you can customize the installation to your needs and preferences.