This is a sample in various programming languages that demonstrates how developers can use the new Visual Studio setup query API.
Перейти к файлу
microsoft-github-policy-service[bot] a2d554616a Microsoft mandatory file 2023-06-02 15:23:20 -07:00
.nuget Example scripts to locate and run msbuild 2017-11-08 13:20:10 -08:00
.vscode ms-vscode.csharp to ms-dotnettools.csharp 2020-03-07 12:32:21 -08:00
Setup.Configuration.CS Add sample to enumerate catalog info 2017-07-17 12:33:25 -07:00
Setup.Configuration.VB Add sample to enumerate catalog info 2017-07-17 12:33:25 -07:00
Setup.Configuration.VC Updates for PR feedback 2017-07-17 12:33:25 -07:00
tools Example scripts to locate and run msbuild 2017-11-08 13:20:10 -08:00
.gitattributes Add .gitignore and .gitattributes. 2016-08-09 21:51:45 -07:00
.gitignore Add back stylecop.json and rename solution 2016-09-04 01:02:39 -07:00
CODE_OF_CONDUCT.md Add Code of Conduct 2019-05-13 16:25:31 -07:00
LICENSE.txt Initial project commits 2016-08-10 00:07:17 -07:00
README.md Add Code of Conduct 2019-05-13 16:25:31 -07:00
SECURITY.md Microsoft mandatory file 2023-06-02 15:23:20 -07:00
Samples.sln Add back stylecop.json and rename solution 2016-09-04 01:02:39 -07:00
nuget.config Update packages references to RC 2016-11-29 14:02:58 -08:00
stylecop.json Add back stylecop.json and rename solution 2016-09-04 01:02:39 -07:00

README.md

Visual Studio Setup Configuration Samples

The included samples show how to use the new setup configuration API for discovering instances of Visual Studio 2017 and newer.

Visual Studio Instances

You can install multiple instances of Visual Studio with different workloads, or from different channels or versions. The majority of components are now lightweight installs using the same container format as VSIX packages for faster installs and cleaner uninstalls.

This change to the Visual Studio platform requires new ways of discovering Visual Studio where simple registry detection does not provide the flexibility required in many scenarios.

The new setup configuration API provides simple access for native and managed code, as well as a means to output JSON, XML, or other formats for consumption in batch or PowerShell scripts.

Available Packages

The following packages are available on nuget.org that provide access to the setup configuration API.

  • Microsoft.VisualStudio.Setup.Configuration.Native

    Adds the header location and automatically links the library. You only need to add the #include as shown below.

    #include <Setup.Configuration.h>
    
  • Microsoft.VisualStudio.Setup.Configuration.Interop

    Provides embeddable interop types. If the interop types are embedded you do not need to redistribute additional assemblies. Simply instantiate the SetupConfiguration runtime callable wrapper (RCW) as shown below.

    var configuration = new SetupConfiguration();
    

Updates

For the most recent updates to these samples, please see https://github.com/microsoft/vs-setup-samples.

We have published a number of related projects that are intended for real-world scenarios and may show a more extensive use of the APIs than shown in these samples.

  • VSSetup.PowerShell PowerShell module to interact with Visual Studio Setup
  • VSIXBootstrapper An installer that can be chained with other packages to locate the latest VSIXInstaller.exe to use for installing VSIX extensions
  • vswhere Locate Visual Studio 2017 and newer installations

License

Licensed under the MIT license. See LICENSE.txt in the project root for license information.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.