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
8 changes: 5 additions & 3 deletions .github/actions/run-dotnet-tests/run-unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ for tfm in "${TFMS[@]}"; do
[[ -z "$tfm" ]] && continue

echo "πŸ§ͺ $tfm ..."
dotnet test "$PROJECT_PATH" -c "$CONFIGURATION" -f "$tfm" --no-build \
--logger "trx;LogFileName=testResults-$tfm.trx" \
--results-directory "$RESULTS_DIR"
# --timeout ensures test session exits properly (workaround for MTP Linux shutdown bug)
dotnet test --project "$PROJECT_PATH" -c "$CONFIGURATION" -f "$tfm" --no-build \
--report-trx --report-trx-filename "testResults-$tfm.trx" \
--results-directory "$RESULTS_DIR" \
-- --timeout 10m
done
8 changes: 5 additions & 3 deletions .github/actions/run-dotnet-tests/run-win.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ Write-Host "πŸ“‹ Target frameworks: $($tfms -join ', ')"

foreach ($tfm in $tfms) {
Write-Host "πŸ§ͺ $tfm ..."
dotnet test $ProjectPath -c $Configuration -f $tfm --no-build `
--logger "trx;LogFileName=testResults-$tfm.trx" `
--results-directory $ResultsDir
# --timeout ensures test session exits properly (workaround for MTP shutdown bug)
dotnet test --project $ProjectPath -c $Configuration -f $tfm --no-build `
--report-trx --report-trx-filename "testResults-$tfm.trx" `
--results-directory $ResultsDir `
-- --timeout 10m
}
5 changes: 4 additions & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
dotnet-version: |
8.0.x
9.0.x
10.0.x

- name: "Setup Node.js"
if: runner.os == 'Linux'
Expand Down Expand Up @@ -160,6 +161,7 @@ jobs:
dotnet-version: |
8.0.x
9.0.x
10.0.x

- name: "Cache NuGet packages"
uses: actions/cache@v4
Expand All @@ -176,7 +178,8 @@ jobs:
run: dotnet build --configuration Release --no-restore

- name: "Run Unit Tests"
run: dotnet test ./tests/Aspire.Hosting.LocalStack.Unit.Tests/Aspire.Hosting.LocalStack.Unit.Tests.csproj --verbosity normal --configuration Release --no-build
# --timeout ensures test session exits properly (workaround for MTP Linux shutdown bug)
run: dotnet test --project ./tests/Aspire.Hosting.LocalStack.Unit.Tests/Aspire.Hosting.LocalStack.Unit.Tests.csproj --verbosity normal --configuration Release --no-build -- --timeout 5m

- name: "Setup GitHub Packages Authentication"
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
dotnet-version: |
8.0.x
9.0.x
10.0.x

- name: "Cache NuGet packages"
uses: actions/cache@v4
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [13.1.0] - 2025-12-18

### Added

- **Aspire 13.1 Support**: Full compatibility with .NET Aspire 13.1 and .NET 10.0
- **Health Check Improvements**: Added log suppression for `localstack_health_client` to reduce console noise during startup

### Changed

- **Dependencies**: Updated `Aspire.Hosting` to `13.1.0`
- **LocalStack Container**: Updated from `4.10.0` β†’ `4.12.0`
- **Target Frameworks**: Added `net10.0` support
- **Testing Framework**: Migrated from xUnit v3 to TUnit v1.5.70
- 453 tests migrated (432 unit tests, 21 integration tests)
- All tests passing across net8.0, net9.0, and net10.0
- Leverages Microsoft.Testing.Platform for improved performance
- Source-generated test discovery for faster execution
- Async-first assertion API throughout test suite

### Fixed
- **LocalStack Container Health Check**: Improved cancellation handling during application shutdown

## [9.5.3] - 2025-11-04

### Added
Expand Down
6 changes: 3 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<DefaultTargetFramework>net8.0</DefaultTargetFramework>
<AllTargetFrameworks>$(DefaultTargetFramework);net9.0</AllTargetFrameworks>
<DefaultTargetFramework>net10.0</DefaultTargetFramework>
<AllTargetFrameworks>$(DefaultTargetFramework);net8.0;net9.0</AllTargetFrameworks>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -19,7 +19,7 @@
<CheckEolTargetFramework>true</CheckEolTargetFramework>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>

<AspireAppHostSdkVersion>9.5.2</AspireAppHostSdkVersion>
<AspireAppHostSdkVersion>13.1.0</AspireAppHostSdkVersion>

<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
Expand Down
61 changes: 28 additions & 33 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,60 +1,55 @@
<Project>
<ItemGroup>
<!-- third-party analyzers -->
<PackageVersion Include="Meziantou.Analyzer" Version="2.0.238"/>
<PackageVersion Include="Meziantou.Analyzer" Version="2.0.261"/>
<PackageVersion Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="4.14.0"/>
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0"/>
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="10.0.101"/>
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.14.15"/>
<PackageVersion Include="Roslynator.Analyzers" Version="4.14.1"/>
<PackageVersion Include="Roslynator.CodeAnalysis.Analyzers" Version="4.14.1"/>
<PackageVersion Include="Roslynator.Formatting.Analyzers" Version="4.14.1"/>
<PackageVersion Include="Roslynator.Analyzers" Version="4.15.0"/>
<PackageVersion Include="Roslynator.CodeAnalysis.Analyzers" Version="4.15.0"/>
<PackageVersion Include="Roslynator.Formatting.Analyzers" Version="4.15.0"/>
<PackageVersion Include="SecurityCodeScan.VS2019" Version="5.6.7"/>
<PackageVersion Include="SonarAnalyzer.CSharp" Version="10.15.0.120848"/>
<PackageVersion Include="xunit.analyzers" Version="1.24.0"/>
<PackageVersion Include="SonarAnalyzer.CSharp" Version="10.17.0.131074"/>
<PackageVersion Include="NSubstitute.Analyzers.CSharp" Version="1.0.17"/>
<!-- aspire packages -->
<PackageVersion Include="Aspire.Hosting" Version="9.5.2"/>
<PackageVersion Include="Aspire.Hosting.AppHost" Version="9.5.2"/>
<PackageVersion Include="Aspire.Hosting" Version="13.1.0"/>
<PackageVersion Include="Aspire.Hosting.AppHost" Version="13.1.0"/>
<PackageVersion Include="Aspire.Hosting.AWS" Version="9.3.0"/>
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Aspire.Hosting.AWS package version (9.3.0) is incompatible with Aspire.Hosting 13.1.0. This package should be updated to 13.1.0 to match the Aspire.Hosting version to avoid potential runtime compatibility issues.

Suggested change
<PackageVersion Include="Aspire.Hosting.AWS" Version="9.3.0"/>
<PackageVersion Include="Aspire.Hosting.AWS" Version="13.1.0"/>

Copilot uses AI. Check for mistakes.
<!-- aws packages -->
<PackageVersion Include="AWSSDK.Core" Version="4.0.1.2"/>
<PackageVersion Include="AWSSDK.DynamoDBv2" Version="4.0.9.1"/>
<PackageVersion Include="AWSSDK.SQS" Version="4.0.1.12"/>
<PackageVersion Include="AWSSDK.SimpleNotificationService" Version="4.0.2.1"/>
<PackageVersion Include="AWSSDK.S3" Version="4.0.7.14"/>
<PackageVersion Include="AWSSDK.Extensions.NETCore.Setup" Version="4.0.3.8"/>
<PackageVersion Include="AWS.Messaging" Version="1.0.1"/>
<PackageVersion Include="AWSSDK.Core" Version="4.0.3.6"/>
<PackageVersion Include="AWSSDK.DynamoDBv2" Version="4.0.10.4"/>
<PackageVersion Include="AWSSDK.SQS" Version="4.0.2.8"/>
<PackageVersion Include="AWSSDK.SimpleNotificationService" Version="4.0.2.10"/>
<PackageVersion Include="AWSSDK.S3" Version="4.0.15.1"/>
<PackageVersion Include="AWSSDK.Extensions.NETCore.Setup" Version="4.0.3.17"/>
<PackageVersion Include="AWS.Messaging" Version="1.0.2"/>
<PackageVersion Include="AWS.Messaging.Telemetry.OpenTelemetry" Version="1.0.0"/>
<PackageVersion Include="Amazon.Lambda.Core" Version="2.7.1"/>
<PackageVersion Include="Amazon.Lambda.APIGatewayEvents" Version="2.7.1"/>
<PackageVersion Include="Amazon.Lambda.Core" Version="2.8.0"/>
<PackageVersion Include="Amazon.Lambda.APIGatewayEvents" Version="2.7.3"/>
<PackageVersion Include="Amazon.Lambda.SQSEvents" Version="2.2.0"/>
<PackageVersion Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.4.4"/>
<!-- localstack packages -->
<PackageVersion Include="LocalStack.Client" Version="2.0.0"/>
<PackageVersion Include="LocalStack.Client.Extensions" Version="2.0.0"/>
<!-- microsoft packages -->
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0"/>
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="9.10.0"/>
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery.Dns" Version="9.5.2"/>
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="10.1.0"/>
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery.Dns" Version="10.1.0"/>
<!-- opentelemetry packages -->
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.13.1"/>
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.13.1"/>
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.13.0"/>
<PackageVersion Include="OpenTelemetry.Instrumentation.AWS" Version="1.12.1"/>
<PackageVersion Include="OpenTelemetry.Instrumentation.AWSLambda" Version="1.12.1"/>
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.13.0"/>
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.13.0"/>
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.14.0"/>
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.14.0"/>
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.14.0"/>
<PackageVersion Include="OpenTelemetry.Instrumentation.AWS" Version="1.14.0"/>
<PackageVersion Include="OpenTelemetry.Instrumentation.AWSLambda" Version="1.14.0"/>
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.14.0"/>
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.14.0"/>
<!-- third-party packages -->
<PackageVersion Include="Net.Codecrete.QrCodeGenerator" Version="2.0.7"/>
<PackageVersion Include="SkiaSharp" Version="3.119.1"/>
<PackageVersion Include="SkiaSharp.NativeAssets.Linux" Version="3.119.1"/>
<!-- test packages -->
<PackageVersion Include="Aspire.Hosting.Testing" Version="9.5.2"/>
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.0"/>
<PackageVersion Include="MartinCostello.Logging.XUnit.v3" Version="0.6.0" />
<PackageVersion Include="Aspire.Hosting.Testing" Version="13.1.0"/>
<PackageVersion Include="NSubstitute" Version="5.3.0"/>
<PackageVersion Include="xunit.v3" Version="3.1.0"/>
<PackageVersion Include="xunit.v3.runner.console" Version="3.1.0"/>
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5"/>
<PackageVersion Include="TUnit" Version="1.5.70"/>
</ItemGroup>
</Project>
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dotnet add package LocalStack.Aspire.Hosting

> **Package Note**: The package is named `LocalStack.Aspire.Hosting` but uses the namespace `Aspire.Hosting.LocalStack` to align with .NET Aspire hosting conventions. This ensures consistency with other Aspire hosting integrations while maintaining a unique package identity.

**Requirements**: .NET 8.0 or later (supports both .NET 8 and .NET 9)
**Requirements**: .NET 8.0 or later (supports .NET 8, .NET 9, and .NET 10)

### Development Builds

Expand All @@ -37,6 +37,7 @@ This package follows Aspire's **major.minor** versioning but releases **patch ve

- `9.5.x` works with Aspire 9.5.x
- `9.6.x` works with Aspire 9.6.x
- `13.1.x` works with Aspire 13.1.x

We may ship features and fixes between Aspire releases. When upgrading Aspire's minor version, upgrade this package to match.

Expand Down
13 changes: 8 additions & 5 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"sdk": {
"version": "9.0.302",
"rollForward": "latestFeature",
"allowPrerelease": false
}
"sdk": {
"version": "10.0.100",
"rollForward": "latestFeature",
"allowPrerelease": false
},
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<FrameworkReference Include="Microsoft.AspNetCore.App"/>

<PackageReference Include="AWS.Messaging.Telemetry.OpenTelemetry"/>
<PackageReference Include="Amazon.Lambda.APIGatewayEvents"/>

<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol"/>
<PackageReference Include="OpenTelemetry.Extensions.Hosting"/>
Expand Down
2 changes: 1 addition & 1 deletion playground/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Shows how LocalStack integrates with AWS Lambda and API Gateway emulators for se

## Prerequisites

- .NET 9.0 or later
- .NET 10.0 or later
- Docker Desktop (for LocalStack containers)
- Node.js 18+ and AWS CDK v2 (for CDK examples only)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"Aspire_AnalyzerLambda": {
"commandName": "Executable",
"executablePath": "dotnet",
"commandLineArgs": "exec --depsfile ./LocalStack.Lambda.Analyzer.deps.json --runtimeconfig ./LocalStack.Lambda.Analyzer.runtimeconfig.json %USERPROFILE%\\.dotnet\\tools\\.store\\amazon.lambda.testtool\\0.11.0\\amazon.lambda.testtool\\0.11.0\\content\\Amazon.Lambda.RuntimeSupport\\net8.0\\Amazon.Lambda.RuntimeSupport.dll LocalStack.Lambda.Analyzer::LocalStack.Lambda.Analyzer.Function::FunctionHandler",
"workingDirectory": ".\\bin\\$(Configuration)\\net8.0"
"commandLineArgs": "exec --depsfile ./LocalStack.Lambda.Analyzer.deps.json --runtimeconfig ./LocalStack.Lambda.Analyzer.runtimeconfig.json %USERPROFILE%\\.dotnet\\tools\\.store\\amazon.lambda.testtool\\0.11.0\\amazon.lambda.testtool\\0.11.0\\content\\Amazon.Lambda.RuntimeSupport\\net10.0\\Amazon.Lambda.RuntimeSupport.dll LocalStack.Lambda.Analyzer::LocalStack.Lambda.Analyzer.Function::FunctionHandler",
"workingDirectory": ".\\bin\\$(Configuration)\\net10.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"Aspire_RedirectorLambda": {
"commandName": "Executable",
"executablePath": "dotnet",
"commandLineArgs": "exec --depsfile ./LocalStack.Lambda.Redirector.deps.json --runtimeconfig ./LocalStack.Lambda.Redirector.runtimeconfig.json %USERPROFILE%\\.dotnet\\tools\\.store\\amazon.lambda.testtool\\0.11.0\\amazon.lambda.testtool\\0.11.0\\content\\Amazon.Lambda.RuntimeSupport\\net8.0\\Amazon.Lambda.RuntimeSupport.dll LocalStack.Lambda.Redirector::LocalStack.Lambda.Redirector.Function::FunctionHandler",
"workingDirectory": ".\\bin\\$(Configuration)\\net8.0"
"commandLineArgs": "exec --depsfile ./LocalStack.Lambda.Redirector.deps.json --runtimeconfig ./LocalStack.Lambda.Redirector.runtimeconfig.json %USERPROFILE%\\.dotnet\\tools\\.store\\amazon.lambda.testtool\\0.11.0\\amazon.lambda.testtool\\0.11.0\\content\\Amazon.Lambda.RuntimeSupport\\net10.0\\Amazon.Lambda.RuntimeSupport.dll LocalStack.Lambda.Redirector::LocalStack.Lambda.Redirector.Function::FunctionHandler",
"workingDirectory": ".\\bin\\$(Configuration)\\net10.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"Aspire_UrlShortenerLambda": {
"commandName": "Executable",
"executablePath": "dotnet",
"commandLineArgs": "exec --depsfile ./LocalStack.Lambda.UrlShortener.deps.json --runtimeconfig ./LocalStack.Lambda.UrlShortener.runtimeconfig.json %USERPROFILE%\\.dotnet\\tools\\.store\\amazon.lambda.testtool\\0.11.0\\amazon.lambda.testtool\\0.11.0\\content\\Amazon.Lambda.RuntimeSupport\\net8.0\\Amazon.Lambda.RuntimeSupport.dll LocalStack.Lambda.UrlShortener::LocalStack.Lambda.UrlShortener.Function::FunctionHandler",
"workingDirectory": ".\\bin\\$(Configuration)\\net8.0"
"commandLineArgs": "exec --depsfile ./LocalStack.Lambda.UrlShortener.deps.json --runtimeconfig ./LocalStack.Lambda.UrlShortener.runtimeconfig.json %USERPROFILE%\\.dotnet\\tools\\.store\\amazon.lambda.testtool\\0.11.0\\amazon.lambda.testtool\\0.11.0\\content\\Amazon.Lambda.RuntimeSupport\\net10.0\\Amazon.Lambda.RuntimeSupport.dll LocalStack.Lambda.UrlShortener::LocalStack.Lambda.UrlShortener.Function::FunctionHandler",
"workingDirectory": ".\\bin\\$(Configuration)\\net10.0"
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Lambda launch settings reference net8.0 in comments but have been updated to net10.0. However, the working directory paths should use a variable like $(TargetFramework) instead of hardcoded net10.0 to avoid similar issues in future framework updates.

Suggested change
"workingDirectory": ".\\bin\\$(Configuration)\\net10.0"
"workingDirectory": ".\\bin\\$(Configuration)\\$(TargetFramework)"

Copilot uses AI. Check for mistakes.
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
<InternalsVisibleTo Include="Aspire.Hosting.LocalStack.Integration.Tests"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Aspire.Hosting.AppHost"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\src\Aspire.Hosting.LocalStack\Aspire.Hosting.LocalStack.csproj" IsAspireProjectResource="false"/>
<ProjectReference Include="..\LocalStack.Provisioning.Frontend\LocalStack.Provisioning.Frontend.csproj"/>

<PackageReference Include="Aspire.Hosting.AppHost"/>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
<NoWarn>$(NoWarn);CS8002</NoWarn> <!-- AWS CDK packages are not signed -->
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Aspire.Hosting.AppHost"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\src\Aspire.Hosting.LocalStack\Aspire.Hosting.LocalStack.csproj" IsAspireProjectResource="false"/>
<ProjectReference Include="..\LocalStack.Provisioning.Frontend\LocalStack.Provisioning.Frontend.csproj"/>

<PackageReference Include="Aspire.Hosting.AppHost"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>$(AllTargetFrameworks)</TargetFrameworks>
<Version>9.5.3</Version>
<Version>13.1.0</Version>
<IsPackable>true</IsPackable>
<PackageTags>aspire hosting,aspire,localstack,aws,integration,docker,cloud</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ internal static class LocalStackContainerImageTags
/// <summary>
/// The default LocalStack container image tag.
/// </summary>
internal const string Tag = "4.10.0";
internal const string Tag = "4.12.0";
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,17 @@ public async Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context
}
catch (HttpRequestException ex)
{
// Catches network errors including HttpIOException (response ended prematurely during startup)
return HealthCheckResult.Unhealthy("LocalStack health check failed: network error", ex);
}
catch (TaskCanceledException ex) when (ex.InnerException is TimeoutException)
{
return HealthCheckResult.Unhealthy("LocalStack health check timed out", ex);
}
catch (IOException ex)
{
// Catches IO errors (e.g., response ended prematurely) during startup
return HealthCheckResult.Unhealthy("LocalStack is starting up", ex);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Logging;

namespace Aspire.Hosting;

Expand Down Expand Up @@ -308,6 +309,13 @@ private static IResourceBuilder<LocalStackResource> ConfigureHealthCheck(
{
builder.Services.AddHttpClient(Constants.LocalStackHealthClientName, client => client.Timeout = TimeSpan.FromSeconds(5));

// Suppress noisy logs from the health check client during startup
builder.Services.AddLogging(logging =>
{
logging.AddFilter($"System.Net.Http.HttpClient.{Constants.LocalStackHealthClientName}.ClientHandler", LogLevel.Warning);
logging.AddFilter($"System.Net.Http.HttpClient.{Constants.LocalStackHealthClientName}.LogicalHandler", LogLevel.Warning);
});

EndpointReference endpoint = resourceBuilder.Resource.GetEndpoint(LocalStackResource.PrimaryEndpointName);

builder.Services.AddHealthChecks().Add(new HealthCheckRegistration(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,5 @@
<ProjectReference Include="..\..\src\Aspire.Hosting.LocalStack\Aspire.Hosting.LocalStack.csproj"/>
</ItemGroup>

<ItemGroup>
<None Remove="xunit.runner.json"/>
<Content Include="xunit.runner.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

</Project>
Loading
Loading