testcontainers-dotnet
testcontainers-dotnet copied to clipboard
CreateClient method not found with latest Docker.DotNet 3.125.11
Describe the bug Docker.DotNet 3.125.11 recently got released. Installing it explicitly (alongside Testcontainers) and trying to start a container now throws:
System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for 'DotNet.Testcontainers.Configurations.TestcontainersSettings' threw an exception.
Source=Testcontainers
StackTrace:
at DotNet.Testcontainers.Builders.TestcontainersBuilder`1..ctor()
at Program.<<Main>$>d__0.MoveNext() in C:\repos\TestConsole\Program.cs:line 8
This exception was originally thrown at this call stack:
[External Code]
Inner Exception 1:
AggregateException: One or more errors occurred. (Method not found: 'Docker.DotNet.DockerClient Docker.DotNet.DockerClientConfiguration.CreateClient()'.)
Inner Exception 2:
MissingMethodException: Method not found: 'Docker.DotNet.DockerClient Docker.DotNet.DockerClientConfiguration.CreateClient()'.
To Reproduce Steps to reproduce the behavior:
- Create a new empty project
- Install Testcontainers version 2.1.0
- Install Docker.DotNet version 3.125.11
- Try to start a container, e.g. from readme:
var testcontainersBuilder = new TestcontainersBuilder<TestcontainersContainer>()
.WithImage("nginx")
.WithName("nginx")
.WithPortBinding(80)
.WithWaitStrategy(Wait.ForUnixContainer().UntilPortIsAvailable(80));
await using (var testcontainers = testcontainersBuilder.Build())
{
await testcontainers.StartAsync();
_ = WebRequest.Create("http://localhost:80");
}
- Exception gets thrown
Expected behavior I expect the container to start and not throw an exception of a missing method.
Desktop (please complete the following information):
- Testcontainers 2.1.0
- Docker.DotNet 3.125.11
Additional context Want to use Docker.DotNet version 3.125.11 to add default HTTP headers when making requests (added in https://github.com/dotnet/Docker.DotNet/pull/580)
You have to wait for a new version. I have updated the version already (0eaea8b0e26e6457e168d160f237c7c33d8f61a7).
That's great, thanks! Any plans for a prerelease?
I'd like to include the TLS feature with the next snapshot release. No real ETA, but I hope we are done soon.
Thanks for letting me know, will keep an eye on this
Hi again, been waiting for this one, any news?
I would like to add a few more things, but I can publish a snapshot release end of this week.
That would be great, much thanks
Published in 2.2.0-beta.3123645733.