WireMock.Net 1.5.46 is incompatible with TestContainers 3.7.0 (issue 2) #570

Closed
opened 2025-12-29 08:30:20 +01:00 by adam · 3 comments
Owner

Originally created by @ruairica on GitHub (Jan 24, 2024).

Originally assigned to: @StefH on GitHub.

Describe the bug

When using another TestContainers Module that relies on Testcontainers 3.7.0, WireMock container throws an exception.
Program.cs

using DotNet.Testcontainers.Builders;
using WireMock.Net.Testcontainers;
await new WireMockContainerBuilder()
    .WithAutoRemove(true)
    .WithCleanUp(true)
    .Build().StartAsync().ConfigureAwait(false);

await new ContainerBuilder()
    .WithImage("testcontainers/helloworld:1.1.0")
    .WithPortBinding(8080, true)
    .WithWaitStrategy(Wait.ForUnixContainer().UntilHttpRequestIsSucceeded(r => r.ForPort(8080)))
    .Build()
    .StartAsync()
    .ConfigureAwait(false);

this code fails throws exception

Unhandled exception. System.MissingMethodException: Method not found: 'Void DotNet.Testcontainers.Configurations.ContainerConfiguration..ctor(DotNet.Testcontainers.Images.IImage, System.Func`2<Dock
   at WireMock.Net.Testcontainers.WireMockConfiguration..ctor(String username, String password)
   at WireMock.Net.Testcontainers.WireMockContainerBuilder..ctor()

when the csproj is

    <PackageReference Include="WireMock.Net.Testcontainers" Version="1.5.46" />
    <PackageReference Include="Testcontainers.CosmosDb" Version="3.7.0" />

the exception is not thrown when I downgrade Testcontainers.CosmosDb to 3.6.0.

Expected behavior:

On nuget (https://www.nuget.org/packages/WireMock.Net.Testcontainers#dependencies-body-tab) states atleast 3.6.0 TestContainers https://www.nuget.org/packages/Testcontainers/) (>= 3.6.0) so I would expect it not to throw an exception when I upgrade the other module to 3.7.0

Test to reproduce

Create a new console application
add the following to .csproj

  <PackageReference Include="WireMock.Net.Testcontainers" Version="1.5.46" />
    <PackageReference Include="Testcontainers.CosmosDb" Version="3.7.0" />

Program.cs:

using Testcontainers.CosmosDb;
using WireMock.Net.Testcontainers;

await new WireMockContainerBuilder()
    .WithAutoRemove(true)
    .WithCleanUp(true)
    .Build()
    .StartAsync();

await new CosmosDbBuilder()
    .Build()
    .StartAsync()
    .ConfigureAwait(false);
Originally created by @ruairica on GitHub (Jan 24, 2024). Originally assigned to: @StefH on GitHub. ### Describe the bug When using another TestContainers Module that relies on Testcontainers 3.7.0, WireMock container throws an exception. Program.cs ```csharp using DotNet.Testcontainers.Builders; using WireMock.Net.Testcontainers; await new WireMockContainerBuilder() .WithAutoRemove(true) .WithCleanUp(true) .Build().StartAsync().ConfigureAwait(false); await new ContainerBuilder() .WithImage("testcontainers/helloworld:1.1.0") .WithPortBinding(8080, true) .WithWaitStrategy(Wait.ForUnixContainer().UntilHttpRequestIsSucceeded(r => r.ForPort(8080))) .Build() .StartAsync() .ConfigureAwait(false); ``` this code fails throws exception ``` Unhandled exception. System.MissingMethodException: Method not found: 'Void DotNet.Testcontainers.Configurations.ContainerConfiguration..ctor(DotNet.Testcontainers.Images.IImage, System.Func`2<Dock at WireMock.Net.Testcontainers.WireMockConfiguration..ctor(String username, String password) at WireMock.Net.Testcontainers.WireMockContainerBuilder..ctor() ``` when the csproj is ``` <PackageReference Include="WireMock.Net.Testcontainers" Version="1.5.46" /> <PackageReference Include="Testcontainers.CosmosDb" Version="3.7.0" /> ``` the exception is not thrown when I downgrade Testcontainers.CosmosDb to 3.6.0. ### Expected behavior: On nuget (https://www.nuget.org/packages/WireMock.Net.Testcontainers#dependencies-body-tab) states atleast 3.6.0 TestContainers https://www.nuget.org/packages/Testcontainers/) (>= 3.6.0) so I would expect it not to throw an exception when I upgrade the other module to 3.7.0 ### Test to reproduce Create a new console application add the following to .csproj ``` <PackageReference Include="WireMock.Net.Testcontainers" Version="1.5.46" /> <PackageReference Include="Testcontainers.CosmosDb" Version="3.7.0" /> ``` Program.cs: ``` using Testcontainers.CosmosDb; using WireMock.Net.Testcontainers; await new WireMockContainerBuilder() .WithAutoRemove(true) .WithCleanUp(true) .Build() .StartAsync(); await new CosmosDbBuilder() .Build() .StartAsync() .ConfigureAwait(false); ```
adam added the bug label 2025-12-29 08:30:20 +01:00
adam closed this issue 2025-12-29 08:30:20 +01:00
Author
Owner

@StefH commented on GitHub (Jan 24, 2024):

@ruairica
You can try preview version 1.5.46-ci-18317 if that solves your problem.

https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions

@StefH commented on GitHub (Jan 24, 2024): @ruairica You can try preview version `1.5.46-ci-18317` if that solves your problem. https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions
Author
Owner

@StefH commented on GitHub (Jan 25, 2024):

https://github.com/WireMock-Net/WireMock.Net/issues/1059

@StefH commented on GitHub (Jan 25, 2024): https://github.com/WireMock-Net/WireMock.Net/issues/1059
Author
Owner

@StefH commented on GitHub (Jan 25, 2024):

I'll release a new official NuGet today.

@StefH commented on GitHub (Jan 25, 2024): I'll release a new official NuGet today.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net#570