testcontainers-dotnet icon indicating copy to clipboard operation
testcontainers-dotnet copied to clipboard

CreateClient method not found with latest Docker.DotNet 3.125.11

Open BenasB opened this issue 3 years ago • 7 comments
trafficstars

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:

  1. Create a new empty project
  2. Install Testcontainers version 2.1.0
  3. Install Docker.DotNet version 3.125.11
  4. 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");
}
  1. 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)

BenasB avatar Sep 05 '22 09:09 BenasB

You have to wait for a new version. I have updated the version already (0eaea8b0e26e6457e168d160f237c7c33d8f61a7).

HofmeisterAn avatar Sep 05 '22 14:09 HofmeisterAn

That's great, thanks! Any plans for a prerelease?

BenasB avatar Sep 05 '22 14:09 BenasB

I'd like to include the TLS feature with the next snapshot release. No real ETA, but I hope we are done soon.

HofmeisterAn avatar Sep 05 '22 15:09 HofmeisterAn

Thanks for letting me know, will keep an eye on this

BenasB avatar Sep 05 '22 16:09 BenasB

Hi again, been waiting for this one, any news?

BenasB avatar Sep 20 '22 06:09 BenasB

I would like to add a few more things, but I can publish a snapshot release end of this week.

HofmeisterAn avatar Sep 22 '22 11:09 HofmeisterAn

That would be great, much thanks

BenasB avatar Sep 22 '22 11:09 BenasB

Published in 2.2.0-beta.3123645733.

HofmeisterAn avatar Sep 25 '22 21:09 HofmeisterAn