You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have an --install-path parameter, but I'm not sure it works consistently and if you want to use a different install root, you have to specify it on every command.
I think we should probably support specifying the path for the dotnet root / hive that dotnetup uses by default. That should be a setting that is saved in the config, and synced with the env commands.
Then I think the scenario for specifying it on an install command line is really just for untracked installs.
Suggested commands:
dotnetup env set --install-path <PATH> - Set the install path dotnetup will use for dotnet
dotnet sdk install <VERSION> --untracked <PATH> - Install to the specified path in untracked mode. We'd remove the existing --install-path parameter on the install commands
We have an environment variable that lets this work, DOTNET_TESTHOOK_DEFAULT_DOTNET_PATH. Should we simply rename this environment variable to be something like DOTNETUP_DOTNET_HOME?
Adding a real-world case for this, from macOS (dotnetup 0.3.0-preview.1.26511.1, osx-arm64).
Why I needed a custom root: the macOS default, ~/Library/Application Support/dotnetup/dotnet, has a space in it. With wasm-tools, the Emscripten clang wrappers in Microsoft.NET.Runtime.Emscripten.3.1.56.Sdk.osx-arm64 10.0.14 contain CLANG_CC=$(dirname $0)/clang-19, so any WebAssembly build that relinks natively (for example an app using SkiaSharp) fails:
.../tools/bin/clang: line 25: /Users/<user>/Library: No such file or directory
emcc: error: '".../Application Support/dotnetup/dotnet/packs/Microsoft.NET.Runtime.Emscripten.3.1.56.Sdk.osx-arm64/10.0.14/tools/bin/clang" --version' failed (returned 127)
That wrapper is already quoted on release/10.0.1xx in dotnet/dotnet, so it should be fixed in a later servicing release. But other tools that don't quote paths will trip over the same default root.
What happened when I moved:dotnetup install <channels> --install-path ~/dotnet --set-default-install installed fine, but dotnetup env script --shell zsh --dotnet --dotnetup (the line dotnetup init writes into the profile) still emits DOTNET_ROOT and PATH for the old root. dotnetup.config.json stores no path, and env set has no option for one. The only fix was editing the profile hook to pass -d "$HOME/dotnet". So --set-default-install looks like a no-op for new shells, which is the gap this issue describes.
+1 to persisting the root in config and having env follow it. Separately, a default root without spaces on macOS (for example ~/.dotnetup/dotnet, next to the executable) would have avoided this entirely.
Activity
nagilson commentedon Aug 6, 2026
We have an environment variable that lets this work,
DOTNET_TESTHOOK_DEFAULT_DOTNET_PATH. Should we simply rename this environment variable to be something likeDOTNETUP_DOTNET_HOME?kazo0 commentedon Oct 27, 2026
Adding a real-world case for this, from macOS (dotnetup 0.3.0-preview.1.26511.1, osx-arm64).
Why I needed a custom root: the macOS default,
~/Library/Application Support/dotnetup/dotnet, has a space in it. Withwasm-tools, the Emscripten clang wrappers inMicrosoft.NET.Runtime.Emscripten.3.1.56.Sdk.osx-arm6410.0.14 containCLANG_CC=$(dirname $0)/clang-19, so any WebAssembly build that relinks natively (for example an app using SkiaSharp) fails:That wrapper is already quoted on
release/10.0.1xxin dotnet/dotnet, so it should be fixed in a later servicing release. But other tools that don't quote paths will trip over the same default root.What happened when I moved:
dotnetup install <channels> --install-path ~/dotnet --set-default-installinstalled fine, butdotnetup env script --shell zsh --dotnet --dotnetup(the linedotnetup initwrites into the profile) still emitsDOTNET_ROOTandPATHfor the old root.dotnetup.config.jsonstores no path, andenv sethas no option for one. The only fix was editing the profile hook to pass-d "$HOME/dotnet". So--set-default-installlooks like a no-op for new shells, which is the gap this issue describes.+1 to persisting the root in config and having
envfollow it. Separately, a default root without spaces on macOS (for example~/.dotnetup/dotnet, next to the executable) would have avoided this entirely.