Repository navigation
Description
Summary
On macOS, dotnetup installs the .NET SDK and workload packs under ~/Library/Application Support/dotnetup/dotnet by default. Because Application Support contains a space, any SDK target, workload wrapper script, or native AOT tool that invokes a path via sh without quoting fails with No such file or directory (/Users/<user>/Library/Application: No such file or directory or /Users/<user>/Library/as: No such file or directory).
While individual workload scripts/tools should quote paths properly, having a space in the default DOTNET_ROOT on macOS breaks standard out-of-the-box .NET workflows across Android, MAUI, WebAssembly, and iOS. Using a space-free default path on macOS (for example ~/.dotnetup/dotnet next to the dotnetup binary at ~/.dotnetup/dotnetup, or ~/.local/share/dotnetup/dotnet) would avoid this entire class of failures, while the underlying workload tools are also fixed to quote paths with spaces.
Concrete Failures Triggered by ~/Library/Application Support/dotnetup/dotnet
1. Android Release / AOT builds fail in Microsoft.Android.Sdk.Darwin binutils wrapper scripts
Building any Android or .NET MAUI Android project in Release configuration (where Mono AOT is enabled by default) fails when running the binutils wrapper scripts under packs/Microsoft.Android.Sdk.Darwin/<version>/tools/Darwin/binutils/bin/:
aarch64-linux-android-asaarch64-linux-android-ldaarch64-linux-android-striparm-linux-androideabi-as/ld/stripi686-linux-android-as/ld/stripx86_64-linux-android-as/ld/strip
Each wrapper script contains an unquoted $(dirname $0):
#!/bin/bash -e
MY_NAME="$(basename $0)"
MY_DIR="$(cd $(dirname $0);pwd)"
exec "${MY_DIR}"/as @gas-arch=${MY_NAME} "$@"Because $(dirname $0) is unquoted, bash word-splits /Users/<user>/Library/Application Support/dotnetup/... into /Users/<user>/Library/Application and Support/..., causing cd to land in /Users/<user>/Library (or fail) and producing:
Microsoft.Android.Sdk.Aot.targets(123,5): error : /Users/<user>/Library/Application Support/dotnetup/dotnet/packs/Microsoft.Android.Sdk.Darwin/36.1.118/tools/Darwin/binutils/bin/aarch64-linux-android-as: line 5: /Users/<user>/Library/as: No such file or directory
Microsoft.Android.Sdk.Aot.targets(123,5): error : AOT of image obj/Release/net10.0-android/android-arm64/linked/SkiaSharp.dll failed.
2. WebAssembly AOT (RunAOTCompilation=true) fails in mono-aot-cross (compile-in-child and llvm-path)
Publishing any Microsoft.NET.Sdk.WebAssembly or Microsoft.NET.Sdk.BlazorWebAssembly project with <RunAOTCompilation>true</RunAOTCompilation> fails in _WasmAotCompileApp (WasmApp.Common.targets):
WasmApp.Common.targetspassescompile-in-child(on non-Windows) andLLVMPath="$(_WasmLLVMPathForAOT)"toMonoAOTCompiler.- When
compile-in-childis enabled,mono-aot-crossspawns child processes viash -cwithout quoting its own executable path (~/Library/Application Support/dotnetup/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-arm64.Cross.browser-wasm/<version>/tools/mono-aot-cross). mono-aot-crossalso invokes LLVM tools (opt/llc) underllvm-path=/Users/<user>/Library/Application Support/dotnetup/dotnet/packs/Microsoft.NET.Runtime.Emscripten.<version>.Sdk.osx-arm64/<version>/tools/bin/viash -cwithout quoting the path.
Both fail with:
WasmApp.Common.targets(672,5): error : Precompiling failed for obj/Release/net10.0/wasm/for-publish/aot-in/System.Private.CoreLib.dll with exit code 1.
WasmApp.Common.targets(672,5): error : Executing: /Users/<user>/Library/Application Support/dotnetup/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-arm64.Cross.browser-wasm/10.0.15/Sdk/../tools/mono-aot-cross "--wasm-exceptions" "--debug" "--llvm" "--aot=no-opt,static,direct-icalls,deterministic,_child,mattr=simd,nodebug,llvm-path=/Users/<user>/Library/Application Support/dotnetup/dotnet/packs/Microsoft.NET.Runtime.Emscripten.3.1.56.Sdk.osx-arm64/10.0.15/tools/bin/,..."
WasmApp.Common.targets(672,5): error : sh: /Users/<user>/Library/Application: No such file or directory
3. Emscripten native relinking (WasmBuildNative=true) wrapper scripts
In Microsoft.NET.Runtime.Emscripten.*.Sdk.osx-arm64 (e.g., 10.0.14), wrapper scripts in tools/bin/clang used unquoted CLANG_CC=$(dirname $0)/clang-19, failing when WasmBuildNative=true:
.../tools/bin/clang: line 25: /Users/<user>/Library: No such file or directory
4. Apple dotnet build -t:Run (RunCommand unquoted in <Exec>)
Tracked in #57310 / #54917: Microsoft.Sdk.Mobile.targets sets <RunCommand>$(MlaunchPath)</RunCommand> (pointing into ~/Library/Application Support/dotnetup/dotnet/packs/Microsoft.iOS.Sdk.../tools/bin/mlaunch) and Microsoft.NET.Sdk.targets runs <Exec Command="$(RunCommand) $(RunArguments)" /> without quotes, failing with:
/Users/<user>/Library/Application: No such file or directory
Recommendations
- Change
dotnetup's default macOS install root to a path without spaces (for example~/.dotnetup/dotnet, alongside~/.dotnetup/dotnetup, or~/.dotnet/dotnetup), and support persisting custom install paths indotnetupconfig (dotnetup: Support custom dotnet roots #55346). - Fix the unquoted paths in the workload packs/tools so SDK paths with spaces also work:
- Quote
"$(dirname "$0")"inMicrosoft.Android.Sdk.Darwin'stools/Darwin/binutils/bin/*wrapper scripts (dotnet/android). - Quote the child compiler and
llvm-pathcommand invocations inmono-aot-cross(dotnet/runtime).
- Quote
Activity
mattleibow commentedon Nov 26, 2026
One additional note on why a symlink workaround (such as
/usr/local/share/dotnet -> ~/Library/Application Support/dotnetup/dotnet) does not avoid this: the nativedotnethost resolves symlinks viarealpath()on its own executable path when computing the SDK root, soBase Path/$(NetCoreRoot)and all workload pack paths resolved by MSBuild still expand to/Users/<user>/Library/Application Support/dotnetup/dotnet/...with the space even when invoked via/usr/local/share/dotnet/dotnet.github-actions commentedon Nov 26, 2026
🎯 Agentic Issue Triage
Triage Assessment:
@nagilson| @dotnet/dotnetuphigh- The issue directly concerns dotnetup default install path, matching the Area-dotnetup CODEOWNERS section.Similar issues: #57310 (
potentially related) #55346 (potentially related)➡️ Summary: dotnetup's default macOS install path contains a space, breaking Android AOT, WASM AOT, and iOS Run workflows. Consider a space-free default root while workload tools fix path quoting.
Enable TreatWarningsAsErrors in source and use default CsWinRT AOT level
Enable TreatWarningsAsErrors in source and use default CsWinRT AOT level
Enable TreatWarningsAsErrors in source and use default CsWinRT AOT level
Enable TreatWarningsAsErrors in source and use default CsWinRT AOT level
Enable TreatWarningsAsErrors in source and use default CsWinRT AOT level
M-Yankov commentedon Dec 4, 2026
Yesterday this was automatically updated from Visual Studio Code extensions (C# Dev Kit) and no longer able to run the >NET MAUI project (.NET 10). It was working fine before the update and then strange errors appeared (command not recognized), even
dotnet buildfails. According to the copilot the path passed to the command line internally by the tool is not escaped, but the problem is somewhere else. Why (and who) decided to install dontnet for MAC OS in that directory by default???? it should be as in the image:from that that article https://learn.microsoft.com/en-us/dotnet/core/install/how-to-detect-installed-versions?pivots=os-macos
M-Yankov commentedon Dec 4, 2026
The errors I've got:
Where it started
as I mentioned previously from VS Code an extension C# Dev Kit using for running MAUI projects showed this pop-up with the message requiring to update missing sdk version, ok fair enough. But it used the dotnetup and installed the sdks in default directory for MAC
~/Library/Application Support/dotnetup/dotnet(I still keep my opinion that this default directory is wrong, because of the containing space documentation)Also notice the error of the screenshot in technical details that the extension point to that directory too... Meanwhile I already installed the latest SDK version but in different directory. "/user/share/local/dotnet/sdk"