Discussed in #54648
Originally posted by jjonescz June 9, 2026
I'm trying to use dotnetup in CI like this:
curl -fsSL https://aka.ms/dotnetup/get-dotnetup.sh | bash -s -- --install-dir "$HOME/.dotnetup"
export PATH="$HOME/.dotnetup:$PATH"
dotnetup sdk install
source <(dotnetup print-env-script)
(But if there is an easier way, please let me know.)
The problem is that dotnetup print-env-script generates hash -d commands which apparently can return exit code 1. Hence my script fails (because it has set -e like any good script should). I needed to use source <(dotnetup print-env-script) || true but that's not a pretty workaround - it could hide other failures.
Also, btw, does dotnetup sdk install has some explicit option to say "install from global.json"? I don't like that it's only implied now. - tracked in #54692
Discussed in #54648
Originally posted by jjonescz June 9, 2026
I'm trying to use
dotnetupin CI like this:(But if there is an easier way, please let me know.)
The problem is that
dotnetup print-env-scriptgenerateshash -dcommands which apparently can return exit code 1. Hence my script fails (because it hasset -elike any good script should). I needed to usesource <(dotnetup print-env-script) || truebut that's not a pretty workaround - it could hide other failures.Also, btw, does- tracked in #54692dotnetup sdk installhas some explicit option to say "install from global.json"? I don't like that it's only implied now.