Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@
<DotNetRuntimeNet10VersionForTesting>10.0.8</DotNetRuntimeNet10VersionForTesting>
<DotNetSdkNet8VersionForTesting>8.0.415</DotNetSdkNet8VersionForTesting>
<DotNetSdkNet9VersionForTesting>9.0.306</DotNetSdkNet9VersionForTesting>
<DotNetSdkNet11VersionForTesting>11.0.100-preview.6.26359.118</DotNetSdkNet11VersionForTesting>
<!-- Keep these aliases for global.json and non-template test infrastructure. -->
<DotNetRuntimePreviousVersionForTesting>$(DotNetRuntimeNet8VersionForTesting)</DotNetRuntimePreviousVersionForTesting>
<DotNetRuntimeCurrentVersionForTesting>$(DotNetRuntimeNet9VersionForTesting)</DotNetRuntimeCurrentVersionForTesting>
<DotNetSdkPreviousVersionForTesting>$(DotNetSdkNet8VersionForTesting)</DotNetSdkPreviousVersionForTesting>
<DotNetSdkCurrentVersionForTesting>$(DotNetSdkNet9VersionForTesting)</DotNetSdkCurrentVersionForTesting>
<DotNetSdkNet10VersionForTesting>10.0.401</DotNetSdkNet10VersionForTesting>
<XunitV3Version>3.2.2</XunitV3Version>
<XUnitAnalyzersVersion>1.21.0</XUnitAnalyzersVersion>
<XunitRunnerVisualStudioVersion>3.1.5</XunitRunnerVisualStudioVersion>
Expand Down Expand Up @@ -71,11 +66,11 @@
Versions must be available on the dnceng dotnet-public mirror (originally published to nuget.org). -->
<PropertyGroup Label="BlazorAssets">
<MicrosoftAspNetCoreAppInternalAssetsNet10Version>10.0.8</MicrosoftAspNetCoreAppInternalAssetsNet10Version>
<MicrosoftAspNetCoreAppInternalAssetsNet11Version>11.0.0-preview.6.26359.118</MicrosoftAspNetCoreAppInternalAssetsNet11Version>
<MicrosoftAspNetCoreAppInternalAssetsNet11Version>11.0.0-rc.1.26425.128</MicrosoftAspNetCoreAppInternalAssetsNet11Version>
</PropertyGroup>
<!-- .NET 11.0 Package Versions used by project templates -->
<PropertyGroup Label="Net11Preview">
<MicrosoftAspNetCoreOpenApiNet11Version>11.0.0-preview.6.26359.118</MicrosoftAspNetCoreOpenApiNet11Version>
<MicrosoftAspNetCoreOpenApiNet11Version>11.0.0-rc.1.26425.128</MicrosoftAspNetCoreOpenApiNet11Version>
</PropertyGroup>
<!-- .NET 10.0 Package Versions -->
<PropertyGroup Label="Preview">
Expand Down
4 changes: 3 additions & 1 deletion eng/clipack/Common.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@
</PropertyGroup>

<ItemGroup>
<_SharedPackToolProperties Include="CreateRidSpecificToolPackages=true" />
<_SharedPackToolProperties Include="PreBuiltCliBinaryPath=$(_ExtractedNativeBinaryPath)" />
<_SharedPackToolProperties Include="PublishAot=true" />
<_SharedPackToolProperties Include="BundlePayloadPath=" />
Expand Down Expand Up @@ -223,6 +222,7 @@
<Target Name="_PackRidSpecificDotnetTool">
<ItemGroup>
<_PackToolProperties Include="@(_SharedPackToolProperties)" />
<_PackToolProperties Include="CreateRidSpecificToolPackages=true" />
<_PackToolProperties Include="RuntimeIdentifier=$(CliRuntime)" />
<_PackToolProperties Include="PublishDir=$(_CliToolPublishDir)" />
</ItemGroup>
Expand All @@ -244,6 +244,8 @@
<Target Name="_PackPointerDotnetTool">
<ItemGroup>
<_PackPointerProperties Include="@(_SharedPackToolProperties)" />
<!-- RID-specific packages are packed separately from their matching native archives. -->
<_PackPointerProperties Include="CreateRidSpecificToolPackages=false" />
<_PackPointerProperties Include="PublishDir=$(_CliToolPointerPublishDir)" />
<_PackPointerProperties Include="NoBuild=true" />
</ItemGroup>
Expand Down
24 changes: 14 additions & 10 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "10.0.401",
"version": "11.0.100-rc.1.26425.128",
"rollForward": "major",
"allowPrerelease": true,
"paths": [
Expand All @@ -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",
Comment thread
JamesNK marked this conversation as resolved.
Comment thread
Copilot marked this conversation as resolved.
"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)"
]
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,4 @@
<ProjectReference Include="..\BlazorHosted.ClientServiceDefaults\BlazorHosted.ClientServiceDefaults.csproj" />
</ItemGroup>

<!-- This target prototypes the WebAssembly SDK side of project discovery.
Returning the evaluated full path lets the referencing project consume TargetOutputs
without parsing the referenced project file or depending on its physical XML shape. -->
<Target Name="GetWebAssemblyProjectReference"
Returns="@(_WebAssemblyProjectReference)">
<ItemGroup>
<_WebAssemblyProjectReference Include="$(MSBuildProjectFullPath)" />
</ItemGroup>
</Target>

</Project>
13 changes: 0 additions & 13 deletions playground/BlazorHosted/BlazorHosted.Server/BlazorHosted.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,4 @@
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery.Yarp" />
</ItemGroup>

<!-- These targets prototype the contract that will eventually be provided by the SDKs.
The server asks every evaluated ProjectReference whether it is a WebAssembly
project and collects the project paths returned by references that recognize the target. -->
<Target Name="ResolveWebAssemblyProjectReferences">
<MSBuild
Projects="@(ProjectReference)"
Targets="GetWebAssemblyProjectReference"
BuildInParallel="true"
SkipNonexistentTargets="true">
<Output TaskParameter="TargetOutputs" ItemName="WebAssemblyProjectReference" />
</MSBuild>
</Target>

</Project>
4 changes: 1 addition & 3 deletions src/Aspire.Hosting.Blazor/BlazorHostedExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,7 @@ private static HashSet<string> 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
Comment thread
JamesNK marked this conversation as resolved.
//
// The target returns each evaluated WASM ProjectReference. An empty collection is valid
Expand Down
34 changes: 19 additions & 15 deletions tests/Aspire.Hosting.Blazor.Tests/BlazorHostedExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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"));
Expand All @@ -571,27 +587,15 @@ private static (string ServerProjectPath, string ClientProjectPath) CreateBlazor

File.WriteAllText(serverProjectPath, """
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup><TargetFramework>net10.0</TargetFramework></PropertyGroup>
<ItemGroup>
<ProjectReference Include="../Client/Client.csproj" />
</ItemGroup>
<Target Name="ResolveWebAssemblyProjectReferences">
<MSBuild Projects="@(ProjectReference)"
Targets="GetWebAssemblyProjectReference"
BuildInParallel="true"
SkipNonexistentTargets="true">
<Output TaskParameter="TargetOutputs" ItemName="WebAssemblyProjectReference" />
</MSBuild>
</Target>
</Project>
""");
File.WriteAllText(clientProjectPath, """
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<Target Name="GetWebAssemblyProjectReference"
Returns="@(_WebAssemblyProjectReference)">
<ItemGroup>
<_WebAssemblyProjectReference Include="$(MSBuildProjectFullPath)" />
</ItemGroup>
</Target>
<PropertyGroup><TargetFramework>net10.0</TargetFramework></PropertyGroup>
</Project>
""");

Expand All @@ -603,7 +607,7 @@ private static string CreateBlazorHostedServerWithoutClient(TempDirectory tempDi
var serverProjectPath = Path.Combine(tempDirectory.Path, "Server.csproj");
File.WriteAllText(serverProjectPath, """
<Project Sdk="Microsoft.NET.Sdk.Web">
<Target Name="ResolveWebAssemblyProjectReferences" />
<PropertyGroup><TargetFramework>net10.0</TargetFramework></PropertyGroup>
</Project>
""");
return serverProjectPath;
Expand Down
9 changes: 8 additions & 1 deletion tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -289,15 +289,19 @@ public async Task ExplicitStart_StartExecutable()
Assert.Equal("http", u.Name);
});

await startTask.DefaultTimeout(TestConstants.LongTimeoutTimeSpan);
using var serviceAClient = app.CreateHttpClientWithResilience(notStartedResourceName, "http");
Comment thread
JamesNK marked this conversation as resolved.
Assert.Equal("Hello World!", await serviceAClient.GetStringAsync("/", token));

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);

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);
Assert.Equal("Hello World!", await serviceAClient.GetStringAsync("/", token));

await startTask.DefaultTimeout(TestConstants.LongTimeoutTimeSpan);
await app.StopAsync(token).DefaultTimeout(TestConstants.LongTimeoutTimeSpan);
}

Expand Down Expand Up @@ -1264,6 +1268,8 @@ public async Task VerifyExecutableStopStartWorks()
var executablePattern = $"{testName}-servicea-{ReplicaIdRegex}-{suffix}";
var serviceA = await KubernetesHelper.GetResourceByNameMatchAsync<Executable>(kubernetes, executablePattern, r => r.Status?.State == ExecutableState.Running, token).DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
Assert.NotNull(serviceA);
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);

Expand All @@ -1274,6 +1280,7 @@ public async Task VerifyExecutableStopStartWorks()

serviceA = await KubernetesHelper.GetResourceByNameMatchAsync<Executable>(kubernetes, executablePattern, r => r.Status?.State == ExecutableState.Running, token).DefaultTimeout(TestConstants.LongTimeoutDuration);
Assert.NotNull(serviceA);
Assert.Equal("Hello World!", await serviceAClient.GetStringAsync("/", token));

await app.StopAsync(token).DefaultTimeout(TestConstants.DefaultOrchestratorTestLongTimeout);
}
Expand Down
9 changes: 9 additions & 0 deletions tests/Aspire.Hosting.Tests/WithUrlsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using Aspire.Hosting.Dashboard;
using Aspire.Hosting.Eventing;
using Aspire.Hosting.Testing.Tests;
using Aspire.Hosting.Utils;
using Microsoft.AspNetCore.InternalTesting;
using Microsoft.Extensions.DependencyInjection;
Expand Down Expand Up @@ -975,6 +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();
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);

Expand Down Expand Up @@ -1027,6 +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);
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,
Expand Down
6 changes: 3 additions & 3 deletions tests/Infrastructure.Tests/Infrastructure.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<!-- net10.0 (not DefaultTargetFramework=net8.0): references tools/SelectTests, which targets
net10.0 for its Microsoft.Build ProjectGraph dependency, and loads that graph at runtime. -->
<TargetFramework>net10.0</TargetFramework>
<!-- net11.0 (not DefaultTargetFramework=net8.0): references tools/SelectTests, which runs on
the repo SDK's runtime and loads its Microsoft.Build ProjectGraph at runtime. -->
<TargetFramework>net11.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsTestProject>true</IsTestProject>
Expand Down
6 changes: 3 additions & 3 deletions tests/Shared/Aspire.Templates.Testing.targets
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
<PropertyGroup>
<SdkVersionForNet8TFM>$(DotNetSdkNet8VersionForTesting)</SdkVersionForNet8TFM>
<SdkVersionForNet9TFM>$(DotNetSdkNet9VersionForTesting)</SdkVersionForNet9TFM>
<SdkVersionForNet11TFM>$(DotNetSdkNet11VersionForTesting)</SdkVersionForNet11TFM>
<SdkVersionForNet10TFM>$(DotNetSdkNet10VersionForTesting)</SdkVersionForNet10TFM>

<!-- global.json uses the .NET 10 SDK. -->
<!-- global.json uses the .NET 11 SDK. -->
<_GlobalJsonContent>$([System.IO.File]::ReadAllText('$(RepoRoot)global.json'))</_GlobalJsonContent>
<_DotNetCliVersionFromGlobalJson>$([System.Text.RegularExpressions.Regex]::Match($(_GlobalJsonContent), '(%3F&lt;="dotnet": ").*(%3F=")'))</_DotNetCliVersionFromGlobalJson>
<SdkVersionForNet10TFM>$(_DotNetCliVersionFromGlobalJson)</SdkVersionForNet10TFM>
<SdkVersionForNet11TFM>$(_DotNetCliVersionFromGlobalJson)</SdkVersionForNet11TFM>

Comment thread
JamesNK marked this conversation as resolved.
<SdkDirForNet8TFM>$(ArtifactsBinDir)dotnet-8\</SdkDirForNet8TFM>
<SdkStampPathForNet8TFM>$(SdkDirForNet8TFM).version-$(SdkVersionForNet8TFM).stamp</SdkStampPathForNet8TFM>
Expand Down
2 changes: 1 addition & 1 deletion tests/helix/send-to-helix-inner.proj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<!-- Disable playwright tests on helix/linux. Issue: https://github.com/microsoft/aspire/issues/4921 -->
<DisablePlaywrightTests Condition="'$(OS)' != 'Windows_NT'">true</DisablePlaywrightTests>

<DotNetCliVersion>$(DotNetSdkPreviousVersionForTesting)</DotNetCliVersion>
<DotNetCliVersion>$(DotNetSdkNet8VersionForTesting)</DotNetCliVersion>

<!-- dotnet-coverage tool version -->
<_DotNetToolJsonPath>$(RepoRoot).config/dotnet-tools.json</_DotNetToolJsonPath>
Expand Down
2 changes: 1 addition & 1 deletion tools/CreateLayout/CreateLayout.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
Comment thread
JamesNK marked this conversation as resolved.
<OutputType>Exe</OutputType>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down
2 changes: 1 addition & 1 deletion tools/GenerateCITimeline/GenerateCITimeline.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion tools/GenerateTestSummary/GenerateTestSummary.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions tools/SelectTests/SelectTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<!-- net10.0: Microsoft.Build 18.3.x (used by the Layer 1 ProjectGraph) ships only net10.0/net472
managed assets, and the graph is loaded from the repo-local net10.0 SDK via MSBuildLocator. -->
<TargetFramework>net10.0</TargetFramework>
<!-- Run on the repo SDK's runtime. Microsoft.Build 18.3.x supplies compatible net10.0 managed
assets, and the graph is loaded from the repo-local SDK via MSBuildLocator. -->
<TargetFramework>net11.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Loading