dotnet-vs 1.2.0

dotnet tool install --global dotnet-vs --version 1.2.0                
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local dotnet-vs --version 1.2.0                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=dotnet-vs&version=1.2.0                
nuke :add-package dotnet-vs --version 1.2.0                

Icon dotnet-vs

A global tool for running, managing and querying Visual Studio installations

Version Downloads License CI Status CI Version

Installing or updating (same command for both):

dotnet tool update -g dotnet-vs

To get the CI version:

dotnet tool update -g dotnet-vs --no-cache --add-source https://pkg.kzu.io/index.json

Command line parsing is done with Mono.Options so all the following variants for arguments are supported: -flag, --flag, /flag, -flag=value, --flag=value, /flag=value, -flag:value, --flag:value, /flag:value, -flag value, --flag value, /flag value.

Supported commands:

alias

Shows the list of saved aliases

Usage: vs alias [options]

All built-in commands support a -save:[alias] option that will cause the command to be saved with that alias. From that point on, it's possible to just run the command (including all saved arguments) by just running the alias instead.

Examples:

# Save the first VS enterprise with the Xamarin/Mobile workload as the "mobile" alias
> vs -sku:ent -first +mobile -save:mobile

# Runs the saved alias with all the original arguments
> vs mobile

client

Launches Visual Studio in client mode

Usage: vs client [options]
Option Description
rel\|release Run release version
pre\|preview Run preview version
int\|internal Run internal (aka 'dogfood') version
sku: Edition, one of e\|ent\|enterprise, p\|pro\|professional, c\|com\|community, b\|build\|buildtools or t\|test\|testagent
filter: Expression to filter VS instances. E.g. x => x.InstanceId = '123'
first Run first matching instance.
exp\|experimental Run experimental instance instead of regular.
w\|workspaceId: The workspace ID to connect to

config

Opens the config folder.

Usage: vs config [options]
Option Description
rel\|release open release version
pre\|preview open preview version
int\|internal open internal (aka 'dogfood') version
sku: Edition, one of e\|ent\|enterprise, p\|pro\|professional, c\|com\|community, b\|build\|buildtools or t\|test\|testagent
filter: Expression to filter VS instances. E.g. x => x.InstanceId = '123'
first open first matching instance.
exp\|experimental open experimental instance instead of regular.

install

Installs a specific edition of Visual Studio.

Usage: vs install [options]
Option Description
rel\|release install release version
pre\|preview install preview version
int\|internal install internal (aka 'dogfood') version
sku: Edition, one of e\|ent\|enterprise, p\|pro\|professional, c\|com\|community, b\|build\|buildtools or t\|test\|testagent
filter: Expression to filter VS instances. E.g. x => x.InstanceId = '123'
add: A workload ID

You can add specific workload IDs by using the supported workload switches using the + prefix.

See the documentation for the Visual Studio installer command line options for the full list of arguments that can be provided.

Common options are --passive, quiet and --wait, for example.

Examples:

# Installs VS enterprise with the Maui/Mobile workload
# Note the -sku: switch/prefix is optional
> vs install Enterprise +mobile

# Install VS community with the .NET Core, ASP.NET and Azure workloads, 
# shows installation progress and waits for it to finish before returning
> vs install +core +web +azure

kill

Kills running devenv processes.

Usage: vs kill [options]
Option Description
rel\|release kill release version
pre\|preview kill preview version
int\|internal kill internal (aka 'dogfood') version
sku: Edition, one of e\|ent\|enterprise, p\|pro\|professional, c\|com\|community, b\|build\|buildtools or t\|test\|testagent
filter: Expression to filter VS instances. E.g. x => x.InstanceId = '123'
exp\|experimental kill experimental instance instead of regular.
first kill first matching instance.
all kill all instances.

Examples:

# Kill all running instances of Visual Studio
> vs kill all

log

Opens the folder containing the Activity.log file.

Usage: vs log [options]
Option Description
rel\|release open release version
pre\|preview open preview version
int\|internal open internal (aka 'dogfood') version
sku: Edition, one of e\|ent\|enterprise, p\|pro\|professional, c\|com\|community, b\|build\|buildtools or t\|test\|testagent
filter: Expression to filter VS instances. E.g. x => x.InstanceId = '123'
first open first matching instance.
exp\|experimental open experimental instance instead of regular.

modify

Modifies an installation of Visual Studio.

Usage: vs modify [options]
Option Description
rel\|release modify release version
pre\|preview modify preview version
int\|internal modify internal (aka 'dogfood') version
sku: Edition, one of e\|ent\|enterprise, p\|pro\|professional, c\|com\|community, b\|build\|buildtools or t\|test\|testagent
filter: Expression to filter VS instances. E.g. x => x.InstanceId = '123'
first modify first matching instance.
add: A workload ID
remove: A workload ID

A shorthand notation is available for add|remove [workload ID] via the supported workload ID switches/aliases, using the + (for add) and - (for remove) prefixes.

Examples:

# Add .NET Core Workload to installed Visual Studio Preview
> vs modify preview +core

run

This is default command, so typically it does not need to be provided as an argument.

Usage: vs run [options]
Option Description
rel\|release run release version
pre\|preview run preview version
int\|internal run internal (aka 'dogfood') version
sku: Edition, one of e\|ent\|enterprise, p\|pro\|professional, c\|com\|community, b\|build\|buildtools or t\|test\|testagent
filter: Expression to filter VS instances. E.g. x => x.InstanceId = '123'
exp\|experimental run experimental instance instead of regular.
id: Run a specific instance by its ID
f\|first If more than one instance matches the criteria, run the first one sorted by descending build version.
v\|version: Run specific (semantic) version, such as 16.4 or 16.5.3.
w\|wait Wait for the started Visual Studio to exit.
nr\|nodereuse Disable MSBuild node reuse. Useful when testing analyzers, tasks and targets. Defaults to true when running experimental instance.
default Set as the default version to run when no arguments are provided, or remove the current default (with --default-).
requires: A workload ID

All workload switches are available too to filter the instance to run, including using the + prefix/alias syntax.

This command will remember the last VS that was located and run. So the next time you can just run the same instance by simply using vs (since run is the default command and can be omitted).

Examples:

# Runs the first VS enterprise with the Maui workload
> vs -sku:ent -first +maui

# Runs VS 16.8
> vs -v:16.8

# Runs VS 16.9 preview
> vs -v:16.9 -pre

# Runs the last VS that was run
> vs

update

Updates an installation of Visual Studio.

Usage: vs update [options]
Option Description
rel\|release Update release version
pre\|preview Update preview version
int\|internal Update internal (aka 'dogfood') version
sku: Edition, one of e\|ent\|enterprise, p\|pro\|professional, c\|com\|community, b\|build\|buildtools or t\|test\|testagent
filter: Expression to filter VS instances. E.g. x => x.InstanceId = '123'
first Update first matching instance.
all Update all instances.

where

Locates the installed version(s) of Visual Studio that satisfy the requested requirements, optionally retrieving installation properties from it.

Usage: vs where [options]
Option Description
rel\|release show release version
pre\|preview show preview version
int\|internal show internal (aka 'dogfood') version
sku: Edition, one of e\|ent\|enterprise, p\|pro\|professional, c\|com\|community, b\|build\|buildtools or t\|test\|testagent
filter: Expression to filter VS instances. E.g. x => x.InstanceId = '123'
first show first matching instance.
prop\|property: The name of a property to return
list Shows result as a list
requires: A workload ID

Supports same options as vswhere.exe:

  -all           Finds all instances even if they are incomplete and may not launch.
  -prerelease    Also searches prereleases. By default, only releases are searched.
  -products arg  One or more product IDs to find. Defaults to Community, Professional, and Enterprise.
                 Specify "*" by itself to search all product instances installed.
                 See https://aka.ms/vs/workloads for a list of product IDs.
  -requires arg  One or more workload or component IDs required when finding instances.
                 All specified IDs must be installed unless -requiresAny is specified.
                 See https://aka.ms/vs/workloads for a list of workload and component IDs.
  -requiresAny   Find instances with any one or more workload or components IDs passed to -requires.
  -version arg   A version range for instances to find. Example: [15.0,16.0) will find versions 15.*.
  -latest        Return only the newest version and last installed.
  -sort          Sorts the instances from newest version and last installed to oldest.
                 When used with "find", first instances are sorted then files are sorted lexigraphically.
  -legacy        Also searches Visual Studio 2015 and older products. Information is limited.
                 This option cannot be used with either -products or -requires.
  -format arg    Return information about instances found in a format described below.
  -property arg  The name of a property to return. Defaults to "value" format.
                 Use delimiters ".", "/", or "_" to separate object and property names.
                 Example: "properties.nickname" will return the "nickname" property under "properties".
  -include arg   One or more extra properties to include, as described below.
  -find arg      Returns matching file paths under the installation path. Defaults to "value" format.
                 The following patterns are supported:
                 ?  Matches any one character except "\".
                 *  Matches zero or more characters except "\".
                 ** Searches the current directory and subdirectories for the remaining search pattern.
  -nologo        Do not show logo information. Some formats noted below will not show a logo anyway.
  -utf8          Use UTF-8 encoding (recommended for JSON).
  -?, -h, -help  Display this help message.


Extra properties:
  packages       Return an array of packages installed in this instance.
                 Supported only by the "json" and "xml" formats.

Formats:
  json           An array of JSON objects for each instance (no logo).
  text           Colon-delimited properties in separate blocks for each instance (default).
  value          A single property specified by the -property parameter (no logo).
  xml            An XML data set containing instances (no logo).

A shorthand notation is available for -requires [workload ID] via the supported workload ID switches, using the + prefix (see below).

See also vswhere on GitHub.

Workload ID switches

For commands that receive workload ID switches (i.e. vs where -requires [WORKLOAD_ID] or vs install --add [WORKLOAD_ID]), the following aliases are available:

Alias Workload ID
mobile Microsoft.VisualStudio.Workload.NetCrossPlat
xamarin Microsoft.VisualStudio.Workload.NetCrossPlat
maui Microsoft.VisualStudio.Workload.NetCrossPlat
core Microsoft.NetCore.Component.DevelopmentTools
azure Microsoft.VisualStudio.Workload.Azure
data Microsoft.VisualStudio.Workload.Data
desktop Microsoft.VisualStudio.Workload.ManagedDesktop
unity Microsoft.VisualStudio.Workload.ManagedGame
native Microsoft.VisualStudio.Workload.NativeDesktop
web Microsoft.VisualStudio.Workload.NetWeb
node Microsoft.VisualStudio.Workload.Node
office Microsoft.VisualStudio.Workload.Office
py Microsoft.VisualStudio.Workload.Python
python Microsoft.VisualStudio.Workload.Python
uwp Microsoft.VisualStudio.Workload.Universal
vsx Microsoft.VisualStudio.Workload.VisualStudioExtension

The aliases are converted to the appropriate switch automatically, such as into -requires [ID] or --add [ID]. Additionally, depending on the command being run, the aliases might use a + prefix (like +mobile), which might make for a more intuitive command line, such as vs install +mobile -sku:enterprise or vs +mobile (runs the VS with the mobile workload installed). The modify command uses + and - prefix to add or remove workloads respectively, for example.

Sponsors

Clarius Org Christian Findlay C. Augusto Proiete Kirill Osenkov MFB Technologies, Inc. Amazon Web Services SandRock David Pallmann

Sponsor this project  

Learn more about GitHub Sponsors

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
1.2.0 73,329 8/18/2022
1.1.1 5,097 11/5/2021
1.1.0 5,231 8/10/2021
1.0.0 2,210 2/1/2021
0.9.4 1,743 1/4/2021
0.9.3 1,764 12/21/2020
0.9.2 1,544 12/9/2020
0.9.1 1,470 12/9/2020
0.9.0 1,566 12/8/2020
0.3.89 1,694 11/20/2020
0.3.88 1,398 11/20/2020
0.3.87 2,002 11/4/2020
0.3.86 1,360 10/29/2020
0.3.85 1,538 10/24/2020
0.3.83 1,621 10/9/2020
0.3.82 1,550 9/30/2020
0.3.81 1,698 9/30/2020
0.3.80 1,672 9/22/2020
0.3.79 1,555 9/22/2020
0.3.77 1,311 8/24/2020
0.3.76 1,553 8/21/2020
0.3.75 1,290 8/21/2020
0.3.74 1,183 8/18/2020
0.3.73 1,378 6/11/2020
0.3.72 1,428 6/9/2020
0.3.68 1,391 5/27/2020
0.3.67 1,275 5/22/2020
0.3.66 1,338 5/11/2020
0.3.63 1,405 5/6/2020
0.3.57 1,610 5/5/2020
0.3.55 1,382 5/3/2020
0.3.54 1,481 5/3/2020
0.3.53 1,375 5/3/2020
0.3.52 1,421 5/3/2020
0.3.51 1,498 5/3/2020
0.3.50 1,445 5/2/2020
0.3.49 1,627 5/2/2020
0.3.48 1,490 5/2/2020
0.3.47 1,468 5/2/2020
0.3.46 1,381 5/2/2020
0.3.45 1,434 5/2/2020
0.3.44 1,536 5/2/2020
0.3.43 1,507 5/1/2020
0.3.40 1,443 4/29/2020
0.3.37 1,650 4/29/2020
0.3.36 1,610 4/28/2020
0.3.35 1,707 4/28/2020
0.3.34 1,620 4/27/2020
0.3.33 1,753 4/27/2020
0.3.32 1,468 4/27/2020
0.3.30 1,571 4/27/2020
0.3.12 1,442 4/23/2020
0.3.7 1,590 4/16/2020
0.3.5 1,615 2/22/2020