From b57e684957784657266e27ec1fa7efa91147926e Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Wed, 9 Sep 2026 07:25:39 +0800 Subject: [PATCH 1/3] Update to .NET 11 RC1 SDK --- eng/Versions.props | 12 +++---- eng/clipack/Common.projitems | 4 ++- global.json | 24 +++++++------ .../BlazorHosted.Server/BlazorHosted.csproj | 13 ------- .../BlazorHostedExtensions.cs | 4 +-- .../BlazorHostedExtensionsTests.cs | 34 +++++++++++-------- .../DistributedApplicationTests.cs | 9 ++++- tests/Aspire.Hosting.Tests/WithUrlsTests.cs | 5 +++ .../Infrastructure.Tests.csproj | 6 ++-- tests/Shared/Aspire.Templates.Testing.targets | 6 +--- tests/helix/send-to-helix-inner.proj | 2 +- tools/CreateLayout/CreateLayout.csproj | 2 +- .../GenerateCITimeline.csproj | 2 +- .../GenerateTestSummary.csproj | 2 +- tools/SelectTests/SelectTests.csproj | 6 ++-- 15 files changed, 65 insertions(+), 66 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 4aa714354fc..b1a16f78ffc 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -14,12 +14,8 @@ 10.0.8 8.0.415 9.0.306 - 11.0.100-preview.6.26359.118 - - $(DotNetRuntimeNet8VersionForTesting) - $(DotNetRuntimeNet9VersionForTesting) - $(DotNetSdkNet8VersionForTesting) - $(DotNetSdkNet9VersionForTesting) + 10.0.400 + 11.0.100-rc.1.26425.128 3.2.2 1.21.0 3.1.5 @@ -71,11 +67,11 @@ Versions must be available on the dnceng dotnet-public mirror (originally published to nuget.org). --> 10.0.8 - 11.0.0-preview.6.26359.118 + 11.0.0-rc.1.26425.128 - 11.0.0-preview.6.26359.118 + 11.0.0-rc.1.26425.128 diff --git a/eng/clipack/Common.projitems b/eng/clipack/Common.projitems index 9baf2383d61..abe8b194489 100644 --- a/eng/clipack/Common.projitems +++ b/eng/clipack/Common.projitems @@ -190,7 +190,6 @@ - <_SharedPackToolProperties Include="CreateRidSpecificToolPackages=true" /> <_SharedPackToolProperties Include="PreBuiltCliBinaryPath=$(_ExtractedNativeBinaryPath)" /> <_SharedPackToolProperties Include="PublishAot=true" /> <_SharedPackToolProperties Include="BundlePayloadPath=" /> @@ -223,6 +222,7 @@ <_PackToolProperties Include="@(_SharedPackToolProperties)" /> + <_PackToolProperties Include="CreateRidSpecificToolPackages=true" /> <_PackToolProperties Include="RuntimeIdentifier=$(CliRuntime)" /> <_PackToolProperties Include="PublishDir=$(_CliToolPublishDir)" /> @@ -244,6 +244,8 @@ <_PackPointerProperties Include="@(_SharedPackToolProperties)" /> + + <_PackPointerProperties Include="CreateRidSpecificToolPackages=false" /> <_PackPointerProperties Include="PublishDir=$(_CliToolPointerPublishDir)" /> <_PackPointerProperties Include="NoBuild=true" /> diff --git a/global.json b/global.json index a75019aaf10..515cb94ed05 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "10.0.401", + "version": "11.0.100-rc.1.26425.128", "rollForward": "major", "allowPrerelease": true, "paths": [ @@ -10,23 +10,27 @@ "errorMessage": "The .NET SDK could not be found. Run ./restore.sh (Linux/macOS) or ./restore.cmd (Windows) to install the local SDK." }, "tools": { - "dotnet": "10.0.401", + "dotnet": "11.0.100-rc.1.26425.128", "runtimes": { "dotnet/x64": [ - "$(DotNetRuntimePreviousVersionForTesting)", - "$(DotNetRuntimeCurrentVersionForTesting)" + "$(DotNetRuntimeNet8VersionForTesting)", + "$(DotNetRuntimeNet9VersionForTesting)", + "$(DotNetRuntimeNet10VersionForTesting)" ], "dotnet/arm64": [ - "$(DotNetRuntimePreviousVersionForTesting)", - "$(DotNetRuntimeCurrentVersionForTesting)" + "$(DotNetRuntimeNet8VersionForTesting)", + "$(DotNetRuntimeNet9VersionForTesting)", + "$(DotNetRuntimeNet10VersionForTesting)" ], "aspnetcore/x64": [ - "$(DotNetRuntimePreviousVersionForTesting)", - "$(DotNetRuntimeCurrentVersionForTesting)" + "$(DotNetRuntimeNet8VersionForTesting)", + "$(DotNetRuntimeNet9VersionForTesting)", + "$(DotNetRuntimeNet10VersionForTesting)" ], "aspnetcore/arm64": [ - "$(DotNetRuntimePreviousVersionForTesting)", - "$(DotNetRuntimeCurrentVersionForTesting)" + "$(DotNetRuntimeNet8VersionForTesting)", + "$(DotNetRuntimeNet9VersionForTesting)", + "$(DotNetRuntimeNet10VersionForTesting)" ] } }, diff --git a/playground/BlazorHosted/BlazorHosted.Server/BlazorHosted.csproj b/playground/BlazorHosted/BlazorHosted.Server/BlazorHosted.csproj index 6a9921f54d5..d2ae4ecbf04 100644 --- a/playground/BlazorHosted/BlazorHosted.Server/BlazorHosted.csproj +++ b/playground/BlazorHosted/BlazorHosted.Server/BlazorHosted.csproj @@ -15,17 +15,4 @@ - - - - - - - diff --git a/src/Aspire.Hosting.Blazor/BlazorHostedExtensions.cs b/src/Aspire.Hosting.Blazor/BlazorHostedExtensions.cs index db2d3e31144..595033a8078 100644 --- a/src/Aspire.Hosting.Blazor/BlazorHostedExtensions.cs +++ b/src/Aspire.Hosting.Blazor/BlazorHostedExtensions.cs @@ -203,9 +203,7 @@ private static HashSet GetReferencedResourceNames(IResource resource) return null; } - // ResolveWebAssemblyProjectReferences is temporarily defined by the BlazorHosted sample - // because Aspire currently builds with the .NET 10 SDK. The target has moved into the - // .NET 11 Static Web Assets SDK, so the sample copy can be removed once Aspire adopts it: + // ResolveWebAssemblyProjectReferences is provided by the .NET 11 Static Web Assets SDK: // https://github.com/dotnet/sdk/blob/c0fb107a5474a2993546bc574fd7a6daac9fd7aa/src/StaticWebAssetsSdk/Sdk/Sdk.targets // // The target returns each evaluated WASM ProjectReference. An empty collection is valid diff --git a/tests/Aspire.Hosting.Blazor.Tests/BlazorHostedExtensionsTests.cs b/tests/Aspire.Hosting.Blazor.Tests/BlazorHostedExtensionsTests.cs index eb543ad5be7..f95fbab1174 100644 --- a/tests/Aspire.Hosting.Blazor.Tests/BlazorHostedExtensionsTests.cs +++ b/tests/Aspire.Hosting.Blazor.Tests/BlazorHostedExtensionsTests.cs @@ -195,6 +195,7 @@ public async Task ProxyService_WithWasmClient_UsesResolvedClientProjectAsWebRoot using var fileSystemService = new TestFileSystemService(); using var tempDirectory = fileSystemService.TempDirectory.CreateTempSubdirectory("blazor-hosted"); var (serverProjectPath, clientProjectPath) = CreateBlazorHostedProjects(tempDirectory); + await RestoreProjectAsync(serverProjectPath); using var builder = TestDistributedApplicationBuilder.Create(testOutputHelper); ConfigureBrowserDebugging(builder); @@ -224,6 +225,7 @@ public async Task ProxyService_WithoutWasmClient_HidesDebugCommand() using var fileSystemService = new TestFileSystemService(); using var tempDirectory = fileSystemService.TempDirectory.CreateTempSubdirectory("blazor-hosted"); var serverProjectPath = CreateBlazorHostedServerWithoutClient(tempDirectory); + await RestoreProjectAsync(serverProjectPath); using var builder = TestDistributedApplicationBuilder.Create(testOutputHelper); ConfigureBrowserDebugging(builder); @@ -562,6 +564,20 @@ private static void ConfigureBrowserDebugging(IDistributedApplicationBuilder bui """{"protocols_supported":["2024-03-03"],"supported_launch_configurations":["browser"]}"""; } + private static async Task RestoreProjectAsync(string projectPath) + { + var result = await BlazorDotNetCliRunner.RunAsync( + projectPath, + "restore", + ["--ignore-failed-sources", "-nologo"], + machineReadableOutput: false, + CancellationToken.None); + + Assert.True( + result.Started && result.ExitCode == 0, + $"Failed to restore '{projectPath}'.{Environment.NewLine}{result.StandardOutput}{Environment.NewLine}{result.StandardError}"); + } + private static (string ServerProjectPath, string ClientProjectPath) CreateBlazorHostedProjects(TempDirectory tempDirectory) { var serverDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.Path, "Server")); @@ -571,27 +587,15 @@ private static (string ServerProjectPath, string ClientProjectPath) CreateBlazor File.WriteAllText(serverProjectPath, """ + net10.0 - - - - - """); File.WriteAllText(clientProjectPath, """ - - - <_WebAssemblyProjectReference Include="$(MSBuildProjectFullPath)" /> - - + net10.0 """); @@ -603,7 +607,7 @@ private static string CreateBlazorHostedServerWithoutClient(TempDirectory tempDi var serverProjectPath = Path.Combine(tempDirectory.Path, "Server.csproj"); File.WriteAllText(serverProjectPath, """ - + net10.0 """); return serverProjectPath; diff --git a/tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs b/tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs index b36199ed280..89d673a63bc 100644 --- a/tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs +++ b/tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs @@ -289,6 +289,10 @@ public async Task ExplicitStart_StartExecutable() Assert.Equal("http", u.Name); }); + await startTask.DefaultTimeout(TestConstants.LongTimeoutTimeSpan); + await app.WaitForTextAsync("Application started.", notStartedResourceName, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); + using var serviceAClient = app.CreateHttpClientWithResilience(notStartedResourceName, "http"); + logger.LogInformation("Stop resource."); await orchestrator.StopResourceAsync(notStartedResourceEvent.ResourceId, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Finished, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); @@ -296,8 +300,8 @@ public async Task ExplicitStart_StartExecutable() logger.LogInformation("Start resource again"); await orchestrator.StartResourceAsync(notStartedResourceEvent.ResourceId, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); + await serviceAClient.GetStringAsync("/", token); - await startTask.DefaultTimeout(TestConstants.LongTimeoutTimeSpan); await app.StopAsync(token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); } @@ -1264,6 +1268,8 @@ public async Task VerifyExecutableStopStartWorks() var executablePattern = $"{testName}-servicea-{ReplicaIdRegex}-{suffix}"; var serviceA = await KubernetesHelper.GetResourceByNameMatchAsync(kubernetes, executablePattern, r => r.Status?.State == ExecutableState.Running, token).DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout); Assert.NotNull(serviceA); + await app.WaitForTextAsync("Application started.", testProgram.ServiceABuilder.Resource.Name, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); + using var serviceAClient = app.CreateHttpClientWithResilience(testProgram.ServiceABuilder.Resource.Name, "http"); await orchestrator.StopResourceAsync(serviceA.Metadata.Name, token).DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout); @@ -1274,6 +1280,7 @@ public async Task VerifyExecutableStopStartWorks() serviceA = await KubernetesHelper.GetResourceByNameMatchAsync(kubernetes, executablePattern, r => r.Status?.State == ExecutableState.Running, token).DefaultTimeout(TestConstants.LongTimeoutDuration); Assert.NotNull(serviceA); + await serviceAClient.GetStringAsync("/", token); await app.StopAsync(token).DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout); } diff --git a/tests/Aspire.Hosting.Tests/WithUrlsTests.cs b/tests/Aspire.Hosting.Tests/WithUrlsTests.cs index d88d02e4e14..28bb44fd05f 100644 --- a/tests/Aspire.Hosting.Tests/WithUrlsTests.cs +++ b/tests/Aspire.Hosting.Tests/WithUrlsTests.cs @@ -3,6 +3,7 @@ using Aspire.Hosting.Dashboard; using Aspire.Hosting.Eventing; +using Aspire.Hosting.Tests.Utils; using Aspire.Hosting.Utils; using Microsoft.AspNetCore.InternalTesting; using Microsoft.Extensions.DependencyInjection; @@ -975,6 +976,9 @@ public async Task WithUrlCanAddUrlFromAnotherResourcesEndpoint() && e.Snapshot.Urls.Length == resourceB.Resource.GetEndpoints().ToArray().Length + 1 && e.Snapshot.Urls.All(u => !u.IsInactive), default).DefaultTimeout(); + await Task.WhenAll( + app.WaitForTextAsync("Application started.", resourceA.Resource.Name), + app.WaitForTextAsync("Application started.", resourceB.Resource.Name)).DefaultTimeout(); await app.StopAsync().DefaultTimeout(TestConstants.LongTimeoutDuration); @@ -1027,6 +1031,7 @@ public async Task WithUrlFromAnotherResourcesEndpointTracksThatResourcesRunningS // Start resource A. Resource B never changes state itself, but its cross-resource URL should become active. var startResult = await app.ResourceCommands.ExecuteCommandAsync(resourceA.Resource, KnownResourceCommands.StartCommand).DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout); Assert.True(startResult.Success, startResult.Message); + await app.WaitForTextAsync("Application started.", resourceA.Resource.Name).DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout); resourceEvent = await rns.WaitForResourceAsync( resourceB.Resource.Name, diff --git a/tests/Infrastructure.Tests/Infrastructure.Tests.csproj b/tests/Infrastructure.Tests/Infrastructure.Tests.csproj index e0a5ea2c38a..663045d09b8 100644 --- a/tests/Infrastructure.Tests/Infrastructure.Tests.csproj +++ b/tests/Infrastructure.Tests/Infrastructure.Tests.csproj @@ -1,9 +1,9 @@ - - net10.0 + + net11.0 enable enable true diff --git a/tests/Shared/Aspire.Templates.Testing.targets b/tests/Shared/Aspire.Templates.Testing.targets index c5593b3d810..b0afb889eb3 100644 --- a/tests/Shared/Aspire.Templates.Testing.targets +++ b/tests/Shared/Aspire.Templates.Testing.targets @@ -12,13 +12,9 @@ $(DotNetSdkNet8VersionForTesting) $(DotNetSdkNet9VersionForTesting) + $(DotNetSdkNet10VersionForTesting) $(DotNetSdkNet11VersionForTesting) - - <_GlobalJsonContent>$([System.IO.File]::ReadAllText('$(RepoRoot)global.json')) - <_DotNetCliVersionFromGlobalJson>$([System.Text.RegularExpressions.Regex]::Match($(_GlobalJsonContent), '(%3F<="dotnet": ").*(%3F=")')) - $(_DotNetCliVersionFromGlobalJson) - $(ArtifactsBinDir)dotnet-8\ $(SdkDirForNet8TFM).version-$(SdkVersionForNet8TFM).stamp diff --git a/tests/helix/send-to-helix-inner.proj b/tests/helix/send-to-helix-inner.proj index 92481d23d8a..a2f16a5d56c 100644 --- a/tests/helix/send-to-helix-inner.proj +++ b/tests/helix/send-to-helix-inner.proj @@ -13,7 +13,7 @@ true - $(DotNetSdkPreviousVersionForTesting) + $(DotNetSdkNet8VersionForTesting) <_DotNetToolJsonPath>$(RepoRoot).config/dotnet-tools.json diff --git a/tools/CreateLayout/CreateLayout.csproj b/tools/CreateLayout/CreateLayout.csproj index 42bb99f8e20..ea1ca16140e 100644 --- a/tools/CreateLayout/CreateLayout.csproj +++ b/tools/CreateLayout/CreateLayout.csproj @@ -1,7 +1,7 @@ - net10.0 + net11.0 Exe enable enable diff --git a/tools/GenerateCITimeline/GenerateCITimeline.csproj b/tools/GenerateCITimeline/GenerateCITimeline.csproj index 268134b7081..2e0d13a98c0 100644 --- a/tools/GenerateCITimeline/GenerateCITimeline.csproj +++ b/tools/GenerateCITimeline/GenerateCITimeline.csproj @@ -2,7 +2,7 @@ Exe - net10.0 + net11.0 enable enable diff --git a/tools/GenerateTestSummary/GenerateTestSummary.csproj b/tools/GenerateTestSummary/GenerateTestSummary.csproj index 32a12e2d3af..ddafb751cc2 100644 --- a/tools/GenerateTestSummary/GenerateTestSummary.csproj +++ b/tools/GenerateTestSummary/GenerateTestSummary.csproj @@ -2,7 +2,7 @@ Exe - net10.0 + net11.0 enable enable diff --git a/tools/SelectTests/SelectTests.csproj b/tools/SelectTests/SelectTests.csproj index a846a4bddcf..062615a9840 100644 --- a/tools/SelectTests/SelectTests.csproj +++ b/tools/SelectTests/SelectTests.csproj @@ -2,9 +2,9 @@ Exe - - net10.0 + + net11.0 enable enable From 96373e9a2f4444270bb8c20e34f636ab31b56f3b Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Wed, 9 Sep 2026 23:59:35 +0800 Subject: [PATCH 2/3] Address .NET 11 upgrade feedback --- eng/Versions.props | 1 - .../BlazorHosted.Client/BlazorHosted.Client.csproj | 10 ---------- .../DistributedApplicationTests.cs | 8 ++++---- tests/Aspire.Hosting.Tests/WithUrlsTests.cs | 14 +++++++++----- tests/Shared/Aspire.Templates.Testing.targets | 6 +++++- 5 files changed, 18 insertions(+), 21 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index b1a16f78ffc..69abc1fa57b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -15,7 +15,6 @@ 8.0.415 9.0.306 10.0.400 - 11.0.100-rc.1.26425.128 3.2.2 1.21.0 3.1.5 diff --git a/playground/BlazorHosted/BlazorHosted.Client/BlazorHosted.Client.csproj b/playground/BlazorHosted/BlazorHosted.Client/BlazorHosted.Client.csproj index 588ff6ff98e..a6dca82a002 100644 --- a/playground/BlazorHosted/BlazorHosted.Client/BlazorHosted.Client.csproj +++ b/playground/BlazorHosted/BlazorHosted.Client/BlazorHosted.Client.csproj @@ -37,14 +37,4 @@ - - - - <_WebAssemblyProjectReference Include="$(MSBuildProjectFullPath)" /> - - - diff --git a/tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs b/tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs index 89d673a63bc..65aa4d13293 100644 --- a/tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs +++ b/tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs @@ -290,8 +290,8 @@ public async Task ExplicitStart_StartExecutable() }); await startTask.DefaultTimeout(TestConstants.LongTimeoutTimeSpan); - await app.WaitForTextAsync("Application started.", notStartedResourceName, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); using var serviceAClient = app.CreateHttpClientWithResilience(notStartedResourceName, "http"); + Assert.Equal("Hello World!", await serviceAClient.GetStringAsync("/", token)); logger.LogInformation("Stop resource."); await orchestrator.StopResourceAsync(notStartedResourceEvent.ResourceId, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); @@ -300,7 +300,7 @@ public async Task ExplicitStart_StartExecutable() logger.LogInformation("Start resource again"); await orchestrator.StartResourceAsync(notStartedResourceEvent.ResourceId, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); await rns.WaitForResourceAsync(notStartedResourceName, e => e.Snapshot.State?.Text == KnownResourceStates.Running, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); - await serviceAClient.GetStringAsync("/", token); + Assert.Equal("Hello World!", await serviceAClient.GetStringAsync("/", token)); await app.StopAsync(token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); } @@ -1268,8 +1268,8 @@ public async Task VerifyExecutableStopStartWorks() var executablePattern = $"{testName}-servicea-{ReplicaIdRegex}-{suffix}"; var serviceA = await KubernetesHelper.GetResourceByNameMatchAsync(kubernetes, executablePattern, r => r.Status?.State == ExecutableState.Running, token).DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout); Assert.NotNull(serviceA); - await app.WaitForTextAsync("Application started.", testProgram.ServiceABuilder.Resource.Name, token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan); using var serviceAClient = app.CreateHttpClientWithResilience(testProgram.ServiceABuilder.Resource.Name, "http"); + Assert.Equal("Hello World!", await serviceAClient.GetStringAsync("/", token)); await orchestrator.StopResourceAsync(serviceA.Metadata.Name, token).DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout); @@ -1280,7 +1280,7 @@ public async Task VerifyExecutableStopStartWorks() serviceA = await KubernetesHelper.GetResourceByNameMatchAsync(kubernetes, executablePattern, r => r.Status?.State == ExecutableState.Running, token).DefaultTimeout(TestConstants.LongTimeoutDuration); Assert.NotNull(serviceA); - await serviceAClient.GetStringAsync("/", token); + Assert.Equal("Hello World!", await serviceAClient.GetStringAsync("/", token)); await app.StopAsync(token).DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout); } diff --git a/tests/Aspire.Hosting.Tests/WithUrlsTests.cs b/tests/Aspire.Hosting.Tests/WithUrlsTests.cs index 28bb44fd05f..4a430b37034 100644 --- a/tests/Aspire.Hosting.Tests/WithUrlsTests.cs +++ b/tests/Aspire.Hosting.Tests/WithUrlsTests.cs @@ -3,7 +3,7 @@ using Aspire.Hosting.Dashboard; using Aspire.Hosting.Eventing; -using Aspire.Hosting.Tests.Utils; +using Aspire.Hosting.Testing.Tests; using Aspire.Hosting.Utils; using Microsoft.AspNetCore.InternalTesting; using Microsoft.Extensions.DependencyInjection; @@ -976,9 +976,12 @@ public async Task WithUrlCanAddUrlFromAnotherResourcesEndpoint() && e.Snapshot.Urls.Length == resourceB.Resource.GetEndpoints().ToArray().Length + 1 && e.Snapshot.Urls.All(u => !u.IsInactive), default).DefaultTimeout(); - await Task.WhenAll( - app.WaitForTextAsync("Application started.", resourceA.Resource.Name), - app.WaitForTextAsync("Application started.", resourceB.Resource.Name)).DefaultTimeout(); + using var resourceAClient = app.CreateHttpClientWithResilience(resourceA.Resource.Name, "api"); + using var resourceBClient = app.CreateHttpClientWithResilience(resourceB.Resource.Name, "http"); + var responses = await Task.WhenAll( + resourceAClient.GetStringAsync("/"), + resourceBClient.GetStringAsync("/")).DefaultTimeout(); + Assert.All(responses, response => Assert.Equal("Hello World!", response)); await app.StopAsync().DefaultTimeout(TestConstants.LongTimeoutDuration); @@ -1031,7 +1034,8 @@ public async Task WithUrlFromAnotherResourcesEndpointTracksThatResourcesRunningS // Start resource A. Resource B never changes state itself, but its cross-resource URL should become active. var startResult = await app.ResourceCommands.ExecuteCommandAsync(resourceA.Resource, KnownResourceCommands.StartCommand).DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout); Assert.True(startResult.Success, startResult.Message); - await app.WaitForTextAsync("Application started.", resourceA.Resource.Name).DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout); + using var resourceAClient = app.CreateHttpClientWithResilience(resourceA.Resource.Name, "api"); + Assert.Equal("Hello World!", await resourceAClient.GetStringAsync("/").DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout)); resourceEvent = await rns.WaitForResourceAsync( resourceB.Resource.Name, diff --git a/tests/Shared/Aspire.Templates.Testing.targets b/tests/Shared/Aspire.Templates.Testing.targets index b0afb889eb3..0e47604713d 100644 --- a/tests/Shared/Aspire.Templates.Testing.targets +++ b/tests/Shared/Aspire.Templates.Testing.targets @@ -13,7 +13,11 @@ $(DotNetSdkNet8VersionForTesting) $(DotNetSdkNet9VersionForTesting) $(DotNetSdkNet10VersionForTesting) - $(DotNetSdkNet11VersionForTesting) + + + <_GlobalJsonContent>$([System.IO.File]::ReadAllText('$(RepoRoot)global.json')) + <_DotNetCliVersionFromGlobalJson>$([System.Text.RegularExpressions.Regex]::Match($(_GlobalJsonContent), '(%3F<="dotnet": ").*(%3F=")')) + $(_DotNetCliVersionFromGlobalJson) $(ArtifactsBinDir)dotnet-8\ $(SdkDirForNet8TFM).version-$(SdkVersionForNet8TFM).stamp From 6b56765335a4cf0958b2feace0bf30d39f5a81cd Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Thu, 10 Sep 2026 10:36:38 +0800 Subject: [PATCH 3/3] Update .NET SDK version for testing to 10.0.401 Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index 69abc1fa57b..f8dca00c462 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -14,7 +14,7 @@ 10.0.8 8.0.415 9.0.306 - 10.0.400 + 10.0.401 3.2.2 1.21.0 3.1.5