From 5c0a16aa0600836c995db45b8ac1779d8c83feeb Mon Sep 17 00:00:00 2001 From: Tom Deseyn Date: Wed, 14 Oct 2026 06:21:53 +0200 Subject: [PATCH] dotnet-monitor-works: fall back to latest .NET 10 version for .NET 11. --- dotnet-monitor-works/test.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dotnet-monitor-works/test.sh b/dotnet-monitor-works/test.sh index 5e71791..4d3c4b8 100755 --- a/dotnet-monitor-works/test.sh +++ b/dotnet-monitor-works/test.sh @@ -4,8 +4,14 @@ set -euo pipefail IFS=$'\n\t' set -x -IFS='.-' read -ra VERSION_SPLIT <<< "$1" -dotnet tool update -g dotnet-monitor --version "${VERSION_SPLIT[0]}.*-*" +IFS='.-' read -ra VERSION_SPLIT <<< "$1" +# Try to install the latest version that matches the major version number. +if ! dotnet tool update -g dotnet-monitor --version "${VERSION_SPLIT[0]}.*-*"; then + # Fall back to latest version when there's no matching major (e.g. .NET 11 uses dotnet-monitor 10.x). + echo "No dotnet-monitor ${VERSION_SPLIT[0]}.x found, falling back to latest version." + dotnet tool update -g dotnet-monitor --prerelease + export DOTNET_ROLL_FORWARD_TO_PRERELEASE=1 +fi export PATH="$HOME/.dotnet/tools:$PATH"