Skip to content

Still having issues with AWS SDK v4 #52

Description

🐛 Bug Description

What happened?
Upgraded AWS SDK to V4 and Localstack.Client / LocalStackClient.Extensions to 2.0. When setting useLocalStack true everything works fine. When setting useLocalStack false I get error saying it cannot find the constructor.

What did you expect to happen?
Both useLocalStack true and useLocalStack false should work.

🔄 Steps to Reproduce

  1. Set useLocalStack to false in appsettings.json
  2. dotnet run

[Minimal code example:]
(https://github.com/blandis-turnberrysolutions/localstack-client-extensions-repro)

📋 Environment Information

LocalStack.Client Version:

  • v1.x (AWS SDK v3) - LTS Branch
  • [X ] v2.x (AWS SDK v4) - Current Branch
  • Version:

LocalStack Information:

  • LocalStack Version:4.12.0
  • LocalStack Image: localstack/localstack:4.12.0
  • LocalStack Services Used: S3, SQS, EventBridge

.NET Information:

  • .NET Version: 10.0.302
  • Operating System: MacOS 26.6
  • IDE/Editor: VS Code

AWS SDK Information:

  • AWS SDK Version: 4.0
  • Services: S3, SQS, EventBridge

🔍 Additional Context

Configuration (Optional):

// Your LocalStack configuration (appsettings.json snippet)
{
    "LocalStack": {
        "UseLocalStack": true,
        "Session": {
            "RegionName": "eu-central-1"
        },
        "Config": {
            "LocalStackHost": "localhost.localstack.cloud",
            "EdgePort": 4566
        }
    },
    "AWS": {
        "Profile": "<test>",
        "Region": "us-east-1"
    }
}

Error Messages/Stack Traces:

Unhandled exception. LocalStack.Client.Extensions.Exceptions.LocalStackClientConfigurationException: ClientFactory<T> missing constructor with AWSOptions parameter.
   at LocalStack.Client.Extensions.AwsClientFactoryWrapper.CreateServiceClient[TClient](IServiceProvider provider, AWSOptions awsOptions)
   at LocalStack.Client.Extensions.ServiceCollectionExtensions.<>c__DisplayClass12_0`1.<GetServiceFactoryDescriptor>b__0(IServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Program.Main(String[] args) in /Users/bradleylandis/development/aws-test/Program.cs:line 30
   at Program.<Main>(String[] args)

✅ Checklist

  • [X ] I have searched existing issues to ensure this is not a duplicate
  • [X ] I have provided all the requested information above
  • [X ] I have tested this with the latest version of LocalStack.Client
  • I have verified this issue occurs with LocalStack (not with real AWS services)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions