.NET
mise installs .NET SDKs, or only a .NET runtime, with Microsoft's dotnet-install script. By default all SDKs share one DOTNET_ROOT, and .NET picks an SDK using the project's global.json.
Quick start
Install the newest .NET 10 SDK for the current project and check which SDK .NET selects:
mise use dotnet@10
mise exec -- dotnet --version
mise exec -- dotnet --list-sdksUse mise use -g dotnet@10 for a personal default. To install another SDK without changing the project's version request, run mise install:
mise install dotnet@8In the default shared mode, dotnet --list-sdks lists every SDK you installed through mise, and .NET, not mise.toml, decides which one runs. For a project that must build with a particular SDK, add a global.json or enable isolated mode before installing.
To install .NET global tools such as dotnet-ef, use the dotnet: backend, for example mise use dotnet:dotnet-ef.
Choosing a version
| Request | Installs |
|---|---|
dotnet@10 | The newest .NET 10 SDK |
dotnet@8.0.425 | That SDK release |
dotnet[runtime=dotnet]@8.0.14 | Only the .NET runtime 8.0.14 |
dotnet[runtime=aspnetcore]@8.0.14 | Only the ASP.NET Core runtime 8.0.14 |
mise lists SDK versions from its versions host, or from Microsoft's release metadata when use_versions_host is off. List them with mise ls-remote dotnet. dotnet-core is an alias for dotnet. See runtime-only installs for the runtime form.
Version files
mise can read the SDK version from global.json. Enable it for .NET. settings add appends to any tools already enabled:
mise settings add idiomatic_version_file_enable_tools dotnetThis changes your global config. Add --local to enable it in the project's mise.toml instead, so teammates get the same behavior. See idiomatic version files.
For example, this file requests an exact SDK and disables .NET's roll-forward:
{
"sdk": {
"version": "8.0.425",
"rollForward": "disable"
}
}Run mise install, then mise exec -- dotnet --version from the project. mise reads sdk.version to install that SDK. .NET itself applies rollForward and the rest of its SDK selection policy; see Microsoft's global.json reference. When global.json is the project's version source, do not also keep a different dotnet version in mise.toml.
Shared and isolated installs
By default mise installs every SDK into one shared directory, which is how .NET expects SDKs to coexist. mise links its own install directory for each version to that shared root, so mise ls still tracks the versions. Without global.json, .NET uses the newest installed SDK, whatever version mise.toml names.
To give each SDK version its own directory, as mise does for most tools, enable isolated mode before installing:
mise settings dotnet.isolated=trueChanging the setting does not move SDKs that are already installed in the shared root, so choose the mode before you install the versions you need.
| Shared (default) | Isolated | |
|---|---|---|
dotnet --list-sdks | Every installed SDK | The selected SDK only |
| Install location | The shared root | ~/.local/share/mise/installs/dotnet/<version> |
| Multi-targeting | Works without switching | Requires switching versions |
The shared root is dotnet.dotnet_root when set. If it is unset, mise uses the DOTNET_ROOT already in your environment, and then ~/.local/share/mise/dotnet-root.
Runtime-only installs
To run .NET applications without building them, install only a runtime with the runtime option:
mise use "dotnet[runtime=dotnet]@8.0.14"
mise exec -- dotnet --list-runtimesruntime value | Framework | Use for |
|---|---|---|
dotnet | Microsoft.NETCore.App | Console apps, libraries |
aspnetcore | Microsoft.AspNetCore.App | ASP.NET Core web apps |
windowsdesktop | Microsoft.WindowsDesktop.App | WPF and WinForms apps |
The version in a runtime-only request is a .NET runtime version, not an SDK version: 8.0.14 means .NET Runtime 8.0.14 (see the .NET release notes). It must be exact. dotnet[runtime=dotnet]@8 does not work, because a prefix resolves against SDK versions. A runtime-only install has no SDK, so dotnet build, dotnet publish and dotnet --version are unavailable.
You can install an SDK for development next to a runtime for a production-like environment:
[tools]
dotnet = ["10", { version = "8.0.14", runtime = "dotnet" }]Environment variables
mise sets these variables for the selected .NET and puts DOTNET_ROOT on PATH:
| Variable | Value |
|---|---|
DOTNET_ROOT | The shared root, or the version's install directory in isolated mode |
DOTNET_MULTILEVEL_LOOKUP | 0, so .NET does not look for SDKs outside DOTNET_ROOT |
DOTNET_CLI_TELEMETRY_OPTOUT | 1 or 0, only when dotnet.cli_telemetry_optout is set |
How mise installs .NET
For each install, mise downloads the current dotnet-install script from dot.net (dotnet-install.sh, or dotnet-install.ps1 on Windows) and runs it with the requested version and install directory. The script downloads the SDK or runtime itself. After an SDK install, mise runs dotnet --list-sdks and checks that the new SDK is listed. Uninstalling a version from the shared root removes only that SDK or runtime directory.
An installed plugin named dotnet takes precedence over the built-in installer. If mise behaves differently from this page, check mise plugins ls and see selecting another implementation.
Tool options
runtime
Installs only the named runtime instead of an SDK. See runtime-only installs.
install_env
Sets environment variables for the dotnet-install script and the dotnet --list-sdks check. It does not reach mise's own download of the script, so set a proxy with https_proxy in the environment that runs mise. Both that download and the script's downloads then use it (see the FAQ).
To opt out of .NET CLI telemetry, set dotnet.cli_telemetry_optout instead. Other generic options are described in tool options.
Settings
Set these under [settings] in a config file, with mise settings set, or with a setting's environment variable where it has one. See which value wins when a setting is set in more than one place.
dotnet.cli_telemetry_optout
Set DOTNET_CLI_TELEMETRY_OPTOUT to opt out of .NET CLI telemetry.
- Type:
boolean - Default: unset
- Environment variable:
MISE_DOTNET_CLI_TELEMETRY_OPTOUT
true sets DOTNET_CLI_TELEMETRY_OPTOUT=1 and false sets it to 0. When
unset, mise leaves the variable alone and .NET uses its own default.
dotnet.dotnet_root
Shared directory that every .NET SDK version installs into.
- Type:
path - Default:
$DOTNET_ROOTwhen set, otherwise~/.local/share/mise/dotnet-root - Environment variable:
MISE_DOTNET_ROOT
SDK versions install side by side here, matching .NET's own multi-version
layout. Ignored when dotnet.isolated is true.
dotnet.isolated
Install each .NET SDK version in its own isolated directory.
- Type:
boolean - Default:
false - Environment variable:
MISE_DOTNET_ISOLATED
With true, each SDK version installs under mise's installs directory like
other tools, and dotnet --list-sdks shows only the active one. With false,
every version shares dotnet.dotnet_root and
dotnet --list-sdks lists all of them.
dotnet.package_flagsdeprecated
Flags for every dotnet: tool; the only flag, prerelease, includes prereleases.
- Type:
string[] - Default:
[] - Environment variable:
MISE_DOTNET_PACKAGE_FLAGS(comma-separated) - Deprecated: Use the
prerelease = truetool option or the globalprereleasessetting instead.
Because it applies to every tool, prerelease here also overrides a tool's own
prerelease = false.
dotnet.registry_url
NuGet service index used to discover dotnet tool versions.
- Type:
URL - Default:
"https://api.nuget.org/v3/index.json" - Environment variable:
MISE_DOTNET_REGISTRY_URL
Installation runs dotnet tool install, which reads its own NuGet.Config and
credentials. Configure a private feed there as well; this setting does not add
an installation source to the dotnet CLI.