Skip to content

Commit 75764dd

Browse files
committed
feat: implement AWS SDK v4 migration with .NET Framework 4.7.2 support
BREAKING CHANGE: Update from AWS SDK v3.7.x to v4.x series with new minimum .NET Framework requirement ### Major Changes: - **AWS SDK Upgrade**: All 70+ AWS SDK packages updated from v3.7.x to v4.x - **Framework Update**: .NET Framework support updated from 4.6.2 to 4.7.2 (AWS SDK v4 requirement) - **Static Interface Compliance**: Implemented AWS SDK v4 static interface methods with conditional compilation ### Core Library Updates: - Update LocalStack.Client target frameworks: netstandard2.0;net472;net8.0;net9.0 - Add conditional compilation support for NET472 framework constants - Update GlobalUsings.cs IsExternalInit support for NET472 ### Extensions Library: - Implement backward-compatible Microsoft.Extensions package strategy - Add conditional version overrides for legacy (.NET Standard 2.0) vs modern (.NET 8+) frameworks - Maintain netstandard2.0;net8.0;net9.0 targets (no .NET Framework for DI scenarios) ### Test Infrastructure: - Update all test projects to net472;net8.0;net9.0 framework support - Implement AWS SDK v4 static interface methods in mock service clients - Add DetermineServiceOperationEndpoint implementation in MockClientConfig - Apply focused pragma suppressions for AWS SDK v4 compatibility ### Build System: - Update build scripts for net472 framework logic - Maintain centralized package management with AWS SDK v4 versions - Add TestPlatform.ObjectModel conditional dependency for net472 Resolves Phase 1 of AWS SDK v4 migration roadmap. All core libraries and test infrastructure now fully compatible with AWS SDK v4.
1 parent 5cd4001 commit 75764dd

File tree

24 files changed

+395
-242
lines changed

24 files changed

+395
-242
lines changed

Directory.Packages.props

Lines changed: 113 additions & 113 deletions
Large diffs are not rendered by default.

build/LocalStack.Build/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ public override void Run(BuildContext context)
9292
}
9393
}
9494

95-
if (context.IsRunningOnLinux() && targetFramework == "net462")
95+
if (context.IsRunningOnLinux() && targetFramework == "net472")
9696
{
97-
context.Warning("Temporarily disabled running net462 tests on Linux because of a problem in mono runtime");
97+
context.Warning("Temporarily disabled running net472 tests on Linux because of a problem in mono runtime");
9898
}
99-
else if (context.IsRunningOnMacOs() && targetFramework == "net462")
99+
else if (context.IsRunningOnMacOs() && targetFramework == "net472")
100100
{
101101
context.RunXUnitUsingMono(targetFramework, $"{testProj.DirectoryPath}/bin/{context.BuildConfiguration}/{targetFramework}/{testProj.AssemblyName}.dll");
102102
}
Lines changed: 63 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,75 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;net8.0;net9.0</TargetFrameworks>
5-
<AssemblyName>LocalStack.Client.Extensions</AssemblyName>
6-
<RootNamespace>LocalStack.Client.Extensions</RootNamespace>
7-
<Version>$(PackageExtensionVersion)</Version>
3+
<PropertyGroup>
4+
<TargetFrameworks>netstandard2.0;net8.0;net9.0</TargetFrameworks>
5+
<AssemblyName>LocalStack.Client.Extensions</AssemblyName>
6+
<RootNamespace>LocalStack.Client.Extensions</RootNamespace>
7+
<Version>$(PackageExtensionVersion)</Version>
88

9-
<Title>LocalStack.NET Client</Title>
10-
<Description>
11-
Extensions for the LocalStack.NET Client to integrate with .NET Core configuration and dependency injection frameworks. The extensions also provides wrapper around AWSSDK.Extensions.NETCore.Setup to use both LocalStack and AWS side-by-side
12-
</Description>
13-
<PackageTags>aws-sdk, localstack, client-library, dotnet, dotnet-core</PackageTags>
14-
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
15-
<PackageReadmeFile>README.md</PackageReadmeFile>
16-
<EnablePackageValidation>true</EnablePackageValidation>
17-
<PackageValidationBaselineVersion>1.2.2</PackageValidationBaselineVersion>
18-
<PublishRepositoryUrl>true</PublishRepositoryUrl>
19-
<EmbedUntrackedSources>true</EmbedUntrackedSources>
20-
<NoWarn>$(NoWarn);CA1510</NoWarn>
21-
</PropertyGroup>
9+
<Title>LocalStack.NET Client</Title>
10+
<Description>
11+
Extensions for the LocalStack.NET Client to integrate with .NET Core configuration and dependency injection frameworks. The extensions also provides wrapper around AWSSDK.Extensions.NETCore.Setup to use both LocalStack and AWS side-by-side
12+
</Description>
13+
<PackageTags>aws-sdk, localstack, client-library, dotnet, dotnet-core</PackageTags>
14+
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
15+
<PackageReadmeFile>README.md</PackageReadmeFile>
16+
<EnablePackageValidation>true</EnablePackageValidation>
17+
<PackageValidationBaselineVersion>1.2.2</PackageValidationBaselineVersion>
18+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
19+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
20+
<NoWarn>$(NoWarn);CA1510</NoWarn>
21+
</PropertyGroup>
2222

23-
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
24-
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
25-
</PropertyGroup>
23+
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
24+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
25+
</PropertyGroup>
2626

27-
<ItemGroup>
28-
<PackageReference Include="AWSSDK.Extensions.NETCore.Setup" />
27+
<ItemGroup>
28+
<PackageReference Include="AWSSDK.Extensions.NETCore.Setup"/>
2929

30-
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" VersionOverride="3.1.32" />
31-
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" VersionOverride="3.1.32" />
32-
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" VersionOverride="3.1.32" />
33-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" VersionOverride="3.1.32" />
34-
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" VersionOverride="3.1.32" />
30+
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" VersionOverride="3.1.32"/>
31+
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" VersionOverride="3.1.32"/>
32+
<!-- <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" VersionOverride="3.1.32"/>-->
33+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" VersionOverride="3.1.32"/>
34+
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" VersionOverride="3.1.32"/>
3535

36-
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
37-
</ItemGroup>
36+
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All"/>
37+
</ItemGroup>
3838

39-
<Target Name="PreBuild" AfterTargets="PreBuildEvent">
40-
<ItemGroup>
41-
<LicenseFile Include="../../LICENSE" />
42-
</ItemGroup>
43-
<ItemGroup>
44-
<ReadmeFile Include="../../README.md" />
45-
</ItemGroup>
46-
<Copy SourceFiles="@(LicenseFile)" DestinationFiles="@(LicenseFile->'./LICENSE.txt')" SkipUnchangedFiles="true" />
47-
<Copy SourceFiles="@(ReadmeFile)" DestinationFiles="@(ReadmeFile->'./README.md')" SkipUnchangedFiles="true" />
48-
</Target>
39+
<!-- Net 8 and anything newer you explicitly list -->
40+
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0' Or '$(TargetFramework)' == 'net9.0' Or '$(TargetFramework)' == 'net10.0'">
41+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" VersionOverride="8.0.0"/>
42+
</ItemGroup>
4943

50-
<ItemGroup>
51-
<None Include="LICENSE.txt" Pack="true" PackagePath="">
52-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
53-
</None>
54-
<None Include="README.md" Pack="true" PackagePath="">
55-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
56-
</None>
57-
<None Include="../../assets/localstack-dotnet-square.png" Pack="true" PackagePath="" />
58-
</ItemGroup>
44+
<!-- Fallback for legacy TFMs (netstandard2.x, net461, etc.) -->
45+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
46+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" VersionOverride="3.1.32"/>
47+
</ItemGroup>
5948

60-
<ItemGroup>
61-
<ProjectReference Include="..\LocalStack.Client\LocalStack.Client.csproj" />
62-
</ItemGroup>
49+
50+
<Target Name="PreBuild" AfterTargets="PreBuildEvent">
51+
<ItemGroup>
52+
<LicenseFile Include="../../LICENSE"/>
53+
</ItemGroup>
54+
<ItemGroup>
55+
<ReadmeFile Include="../../README.md"/>
56+
</ItemGroup>
57+
<Copy SourceFiles="@(LicenseFile)" DestinationFiles="@(LicenseFile->'./LICENSE.txt')" SkipUnchangedFiles="true"/>
58+
<Copy SourceFiles="@(ReadmeFile)" DestinationFiles="@(ReadmeFile->'./README.md')" SkipUnchangedFiles="true"/>
59+
</Target>
60+
61+
<ItemGroup>
62+
<None Include="LICENSE.txt" Pack="true" PackagePath="">
63+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
64+
</None>
65+
<None Include="README.md" Pack="true" PackagePath="">
66+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
67+
</None>
68+
<None Include="../../assets/localstack-dotnet-square.png" Pack="true" PackagePath=""/>
69+
</ItemGroup>
70+
71+
<ItemGroup>
72+
<ProjectReference Include="..\LocalStack.Client\LocalStack.Client.csproj"/>
73+
</ItemGroup>
6374

6475
</Project>

src/LocalStack.Client.Extensions/README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,31 @@
11
# LocalStack .NET Client ![Nuget](https://img.shields.io/nuget/dt/LocalStack.Client) [![NuGet](https://img.shields.io/nuget/v/LocalStack.Client.svg)](https://www.nuget.org/packages/LocalStack.Client/) [![Space Metric](https://localstack-dotnet.testspace.com/spaces/232580/badge?token=bc6aa170f4388c662b791244948f6d2b14f16983)](https://localstack-dotnet.testspace.com/spaces/232580?utm_campaign=metric&utm_medium=referral&utm_source=badge "Test Cases")
22

3+
> ## ⚠️ AWS SDK v4 Transition Notice
4+
>
5+
> **Current Status**: This main branch is under active development for **AWS SDK v4 support (v2.0)**
6+
>
7+
> **Version Strategy**:
8+
> - **v1.x** (AWS SDK v3): Maintenance mode → Available on [sdkv3-lts branch](https://github.com/localstack-dotnet/localstack-dotnet-client/tree/sdkv3-lts) (EOL: July 31, 2026)
9+
> - **v2.x** (AWS SDK v4): Active development → Native AOT support in subsequent v2.x releases
10+
>
11+
> **Migration Timeline**: Q3 2025 for v2.0.0 GA
12+
>
13+
> 📖 **[Read Full Roadmap & Migration Guide →](../../discussions)**
14+
315
![LocalStack](https://github.com/localstack-dotnet/localstack-dotnet-client/blob/master/assets/localstack-dotnet.png?raw=true)
416

517
Localstack.NET is an easy-to-use .NET client for [LocalStack](https://github.com/localstack/localstack), a fully functional local AWS cloud stack. The client library provides a thin wrapper around [aws-sdk-net](https://github.com/aws/aws-sdk-net) which automatically configures the target endpoints to use LocalStack for your local cloud application development.
618

7-
| Package | Stable | Nightly |
19+
## Version Compatibility
20+
21+
| LocalStack.NET Version | AWS SDK Version | .NET Support | Status | Branch |
22+
|------------------------|-----------------|--------------|---------|---------|
23+
| v1.x | AWS SDK v3 | .NET 8, 9, Standard 2.0, Framework 4.6.2 | Maintenance (until July 2026) | [sdkv3-lts](../../tree/sdkv3-lts) |
24+
| v2.x | AWS SDK v4 | .NET 8, 9, Standard 2.0, Framework 4.7.2 | Active Development | [master](../../tree/main) |
25+
26+
## Package Status
27+
28+
| Package | v1.x (AWS SDK v3) | v2.x (AWS SDK v4) - Development |
829
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
930
| LocalStack.Client | [![NuGet](https://img.shields.io/nuget/v/LocalStack.Client.svg)](https://www.nuget.org/packages/LocalStack.Client/) | [![MyGet](https://img.shields.io/myget/localstack-dotnet-client/v/LocalStack.Client.svg?label=myget)](https://www.myget.org/feed/localstack-dotnet-client/package/nuget/LocalStack.Client) |
1031
| LocalStack.Client.Extensions | [![NuGet](https://img.shields.io/nuget/v/LocalStack.Client.Extensions.svg)](https://www.nuget.org/packages/LocalStack.Client.Extensions/) | [![MyGet](https://img.shields.io/myget/localstack-dotnet-client/v/LocalStack.Client.Extensions.svg?label=myget)](https://www.myget.org/feed/localstack-dotnet-client/package/nuget/LocalStack.Client.Extensions) |
@@ -189,4 +210,4 @@ Please refer to [`CHANGELOG.md`](CHANGELOG.md) to see the complete list of chang
189210

190211
## License
191212

192-
Licensed under MIT, see [LICENSE](LICENSE) for the full text.
213+
Licensed under MIT, see [LICENSE](LICENSE) for the full text.

src/LocalStack.Client/GlobalUsings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
global using LocalStack.Client.Utils;
1919

2020
#pragma warning disable MA0048 // File name must match type name
21-
#if NETSTANDARD || NET462
21+
#if NETSTANDARD || NET472
2222
namespace System.Runtime.CompilerServices
2323
{
2424
using System.ComponentModel;

src/LocalStack.Client/LocalStack.Client.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;net462;net8.0;net9.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;net472;net8.0;net9.0</TargetFrameworks>
55
<AssemblyName>LocalStack.Client</AssemblyName>
66
<RootNamespace>LocalStack.Client</RootNamespace>
77

@@ -51,8 +51,8 @@
5151
<None Include="../../assets/localstack-dotnet-square.png" Pack="true" PackagePath="" />
5252
</ItemGroup>
5353

54-
<PropertyGroup Condition="'$(TargetFramework)' == 'net462'">
55-
<DefineConstants>NET462</DefineConstants>
54+
<PropertyGroup Condition="'$(TargetFramework)' == 'net472'">
55+
<DefineConstants>NET472</DefineConstants>
5656
</PropertyGroup>
5757

5858
</Project>

src/LocalStack.Client/README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,31 @@
11
# LocalStack .NET Client ![Nuget](https://img.shields.io/nuget/dt/LocalStack.Client) [![NuGet](https://img.shields.io/nuget/v/LocalStack.Client.svg)](https://www.nuget.org/packages/LocalStack.Client/) [![Space Metric](https://localstack-dotnet.testspace.com/spaces/232580/badge?token=bc6aa170f4388c662b791244948f6d2b14f16983)](https://localstack-dotnet.testspace.com/spaces/232580?utm_campaign=metric&utm_medium=referral&utm_source=badge "Test Cases")
22

3+
> ## ⚠️ AWS SDK v4 Transition Notice
4+
>
5+
> **Current Status**: This main branch is under active development for **AWS SDK v4 support (v2.0)**
6+
>
7+
> **Version Strategy**:
8+
> - **v1.x** (AWS SDK v3): Maintenance mode → Available on [sdkv3-lts branch](https://github.com/localstack-dotnet/localstack-dotnet-client/tree/sdkv3-lts) (EOL: July 31, 2026)
9+
> - **v2.x** (AWS SDK v4): Active development → Native AOT support in subsequent v2.x releases
10+
>
11+
> **Migration Timeline**: Q3 2025 for v2.0.0 GA
12+
>
13+
> 📖 **[Read Full Roadmap & Migration Guide →](../../discussions)**
14+
315
![LocalStack](https://github.com/localstack-dotnet/localstack-dotnet-client/blob/master/assets/localstack-dotnet.png?raw=true)
416

517
Localstack.NET is an easy-to-use .NET client for [LocalStack](https://github.com/localstack/localstack), a fully functional local AWS cloud stack. The client library provides a thin wrapper around [aws-sdk-net](https://github.com/aws/aws-sdk-net) which automatically configures the target endpoints to use LocalStack for your local cloud application development.
618

7-
| Package | Stable | Nightly |
19+
## Version Compatibility
20+
21+
| LocalStack.NET Version | AWS SDK Version | .NET Support | Status | Branch |
22+
|------------------------|-----------------|--------------|---------|---------|
23+
| v1.x | AWS SDK v3 | .NET 8, 9, Standard 2.0, Framework 4.6.2 | Maintenance (until July 2026) | [sdkv3-lts](../../tree/sdkv3-lts) |
24+
| v2.x | AWS SDK v4 | .NET 8, 9, Standard 2.0, Framework 4.7.2 | Active Development | [master](../../tree/main) |
25+
26+
## Package Status
27+
28+
| Package | v1.x (AWS SDK v3) | v2.x (AWS SDK v4) - Development |
829
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
930
| LocalStack.Client | [![NuGet](https://img.shields.io/nuget/v/LocalStack.Client.svg)](https://www.nuget.org/packages/LocalStack.Client/) | [![MyGet](https://img.shields.io/myget/localstack-dotnet-client/v/LocalStack.Client.svg?label=myget)](https://www.myget.org/feed/localstack-dotnet-client/package/nuget/LocalStack.Client) |
1031
| LocalStack.Client.Extensions | [![NuGet](https://img.shields.io/nuget/v/LocalStack.Client.Extensions.svg)](https://www.nuget.org/packages/LocalStack.Client.Extensions/) | [![MyGet](https://img.shields.io/myget/localstack-dotnet-client/v/LocalStack.Client.Extensions.svg?label=myget)](https://www.myget.org/feed/localstack-dotnet-client/package/nuget/LocalStack.Client.Extensions) |
@@ -189,4 +210,4 @@ Please refer to [`CHANGELOG.md`](CHANGELOG.md) to see the complete list of chang
189210

190211
## License
191212

192-
Licensed under MIT, see [LICENSE](LICENSE) for the full text.
213+
Licensed under MIT, see [LICENSE](LICENSE) for the full text.

tests/LocalStack.Client.Extensions.Tests/ServiceCollectionExtensionsTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,9 @@ public void GetRequiredService_Should_Use_Suitable_ClientFactory_To_Create_AwsSe
324324
ServiceProvider provider = serviceCollection.BuildServiceProvider();
325325

326326
mockSession.Setup(session => session.CreateClientByInterface<IMockAmazonService>(It.IsAny<bool>()))
327-
.Returns(() => new MockAmazonServiceClient("tsada", "sadasdas", "sadasda", new MockClientConfig()));
327+
.Returns(() => new MockAmazonServiceClient("tsada", "sadasdas", "sadasda", MockClientConfig.CreateDefaultMockClientConfig()));
328328
mockClientFactory.Setup(wrapper => wrapper.CreateServiceClient<IMockAmazonService>(It.IsAny<IServiceProvider>(), It.IsAny<AWSOptions>()))
329-
.Returns(() => new MockAmazonServiceClient("tsada", "sadasdas", "sadasda", new MockClientConfig()));
329+
.Returns(() => new MockAmazonServiceClient("tsada", "sadasdas", "sadasda", MockClientConfig.CreateDefaultMockClientConfig()));
330330

331331
var mockAmazonService = provider.GetRequiredService<IMockAmazonService>();
332332

0 commit comments

Comments
 (0)