+0
日增长
+0
周增长
994
stars
107
forks
34
watchers
130
prs
219
issues
57
releases
README
Visual Studio Locator ===================== !build status: main Over the years Visual Studio could be discovered using registry keys, but with recent changes to the deployment and extensibility models a new method is needed to discover possibly more than one installed instance. These changes facilitate a smaller, faster default install complimented by on-demand install of other workloads and components. _vswhere_ is designed to be a redistributable, single-file executable that can be used in build or deployment scripts to find where Visual Studio - or other products in the Visual Studio family - is located. For example, if you know the relative path to MSBuild, you can find the root of the Visual Studio install and combine the paths to find what you need. You can emit different formats for information based on what your scripts can consume, including plain text, JSON, and XML. Pull requests may be accepted for other common formats as well. _vswhere_ is included with the installer as of Visual Studio 2017 version 15.2 and later, and can be found at the following location: %ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe. The binary may be executed from that location as needed, installed using popular package managers including WinGet, or the latest version may be downloaded from the releases page. Example If you wanted to find MSBuild - now installed under the Visual Studio 2017 and newer installation root - you could script a command like the following to run the latest version of MSBuild installed. This example uses the new -find parameter in our latest release that searches selected instances for matching file name patterns. You can tailor what instances you select with parameters like -version or -prerelease to find specific versions you support, optionally including prereleases. batch @echo off setlocal enabledelayedexpansion for /f "usebackq tokens=" %%i in (vswhere -latest -requires Microsoft.Component.MSBuild -find MSBuild\\Bin\MSBuild.exe) do ( "%%i" % exit /b !errorlevel! ) You can find more examples in our wiki. Feedback To file issues or suggestions, please use the Issues page for this project on GitHub. License This project is licensed under the MIT license. 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 [email protected] with any additional questions or comments.
Top issues
#310One of my office PC fails to find MSVC when not running in elevated terminal.6 comments · 2024-03-26#339Document possible values of `state`5 comments · 2026-02-04#343Return "empty string" if property doesnt exist on a release3 comments · 2026-04-15#321Feature request: list platform toolset and VC tools versions available1 comments · 2024-12-07#315Compilation fails1 comments · 2024-08-01#330Exact version match does not find installation0 comments · 2025-01-12#264Add codepage integration tests0 comments · 2022-04-29
Latest release
3.1.7 3.1.7 2023-07-05Changes: f39851e70fba0afee200da5b37fe5df45a6da88b Add Vulcan debug arguments to release builds (293) b238e44558eb9960bc7cd8305e871a8baa3c6103 Install .NET 6 before installing NBGV (294) 4af6aa058af09bc9aa7f4b3cd6ab97d37372dfe0 Don't overmatch globstars into filenames (291) [ 290 ] This list of changes was auto generated.