dotnet backend
The dotnet backend installs .NET command-line tool packages from NuGet with dotnet tool install. The unprefixed dotnet tool installs the SDK itself; see the .NET guide for SDK versions and global.json.
Requirements
Install a .NET SDK, plus the runtime the tool package targets. A newer SDK does not guarantee that an older tool runs, because .NET's runtime selection rules still apply. Run mise exec -- dotnet --list-runtimes to see what is installed. When dotnet is in your config, mise installs it before your .NET tools.
用法
Install .NET 8 and a GitVersion release built for it:
mise use dotnet@8 dotnet:[email protected]
mise exec -- dotnet-gitversion /versionThis writes both entries to mise.toml. Add -g to mise use for your global config.
[tools]
dotnet = "8"
"dotnet:GitVersion.Tool" = "6.0.5"To choose another release, run mise ls-remote dotnet:GitVersion.Tool and check that release's runtime requirements. mise use dotnet:GitVersion.Tool without a version records latest.
mise installs each tool into its own directory with --tool-path. It does not create or update a project's .config/dotnet-tools.json manifest.
私有源
mise lists versions from the NuGet service index in dotnet.registry_url, but dotnet tool install downloads the package using its own NuGet.Config and credentials. For a private feed, add it to NuGet.Config and point dotnet.registry_url at its service index; changing the setting alone does not add an install source.
Tool options
Set these on the tool's entry in [tools], or inline, as in 'dotnet:GitVersion.Tool[prerelease=true]'. Options every backend accepts are described under tool options.
install_env
Set environment variables for dotnet tool install:
[tools]
"dotnet:GitVersion.Tool" = { version = "latest", install_env = { DOTNET_NOLOGO = "1" } }prerelease
By default, NuGet prerelease versions are left out of mise ls-remote and latest. Set prerelease = true to include them:
[tools]
"dotnet:GitVersion.Tool" = { version = "latest", prerelease = true }To include prereleases for every tool, set the prereleases setting instead.
Settings
Two settings apply to dotnet: tools. The other dotnet.* settings configure the .NET SDK; see the .NET guide.
请在配置文件的 [settings] 下设置这些值,或使用 mise settings set,也可以使用设置对应的环境变量。 请参阅哪个值生效,了解同一设置在多个位置配置时的优先级。
dotnet.package_flags已弃用
Flags for every dotnet: tool; the only flag, prerelease, includes prereleases.
- 类型:
字符串数组 - 默认值:
[] - 环境变量:
MISE_DOTNET_PACKAGE_FLAGS(按逗号分隔) - 已弃用: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.
- 类型:
URL - 默认值:
"https://api.nuget.org/v3/index.json" - 环境变量:
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.
mise 2026.11.0 and later warn when dotnet.package_flags is set, and mise 2027.11.0 removes it.
故障排除
| Symptom | What to check |
|---|---|
| SDK not found | Run mise exec -- dotnet --info and check any global.json that constrains SDK selection. |
| Required framework missing | Install a runtime or SDK the tool supports, or choose a tool release that targets the runtime you have. |
| Package not found | Check that the package is a .NET tool and that both version listing and installation can reach its feed. |