WireMock.Net 1.5.46 is incompatible with TestContainers 3.7.0 (issue 1) #565

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

Originally created by @lukasszh on GitHub (Jan 23, 2024).

Originally assigned to: @StefH on GitHub.

Describe the bug

After upgrading from .NET 7 to version 8, WireMock cannot be started anymore.

Test to reproduce

  • .NET 8.0
  • Rancher Desktop
  • MacOS 14.2.1
  • wiremock.net.testcontainers/1.5.46

Once this line is added to the IClassFixture of xUnit, the error message appears.

private readonly WireMockContainer _wireMockContainer = new WireMockContainerBuilder().WithAutoRemove(true).Build();

With .NET 7 and the same setup, everything worked perfectly fine.

Stacktrace

System.AggregateException
One or more errors occurred. (Method not found: 'Void DotNet.Testcontainers.Configurations.ContainerConfiguration..ctor(DotNet.Testcontainers.Images.IImage, System.Func`2<Docker.DotNet.Models.ImageInspectResponse,Boolean>, System.String, System.String, System.String, System.String, System.Collections.Generic.IEnumerable`1<System.String>, System.Collections.Generic.IEnumerable`1<System.String>, System.Collections.Generic.IReadOnlyDictionary`2<System.String,System.String>, System.Collections.Generic.IReadOnlyDictionary`2<System.String,System.String>, System.Collections.Generic.IReadOnlyDictionary`2<System.String,System.String>, System.Collections.Generic.IReadOnlyDictionary`2<System.String,DotNet.Testcontainers.Configurations.IResourceMapping>, System.Collections.Generic.IEnumerable`1<DotNet.Testcontainers.Containers.IContainer>, System.Collections.Generic.IEnumerable`1<DotNet.Testcontainers.Configurations.IMount>, System.Collections.Generic.IEnumerable`1<DotNet.Testcontainers.Networks.INetwork>, System.Collections.Generic.IEnumerable`1<System.String>, System.Collections.Generic.IEnumerable`1<System.String>, DotNet.Testcontainers.Configurations.IOutputConsumer, System.Collections.Generic.IEnumerable`1<DotNet.Testcontainers.Configurations.IWaitUntil>, System.Func`3<DotNet.Testcontainers.Containers.IContainer,System.Threading.CancellationToken,System.Threading.Tasks.Task>, System.Nullable`1<Boolean>, System.Nullable`1<Boolean>)'.) (The following constructor parameters did not have matching fixture data: TestFactory factory)
  Exception doesn't have a stacktrace

System.MissingMethodException
Method not found: 'Void DotNet.Testcontainers.Configurations.ContainerConfiguration..ctor(DotNet.Testcontainers.Images.IImage, System.Func`2<Docker.DotNet.Models.ImageInspectResponse,Boolean>, System.String, System.String, System.String, System.String, System.Collections.Generic.IEnumerable`1<System.String>, System.Collections.Generic.IEnumerable`1<System.String>, System.Collections.Generic.IReadOnlyDictionary`2<System.String,System.String>, System.Collections.Generic.IReadOnlyDictionary`2<System.String,System.String>, System.Collections.Generic.IReadOnlyDictionary`2<System.String,System.String>, System.Collections.Generic.IReadOnlyDictionary`2<System.String,DotNet.Testcontainers.Configurations.IResourceMapping>, System.Collections.Generic.IEnumerable`1<DotNet.Testcontainers.Containers.IContainer>, System.Collections.Generic.IEnumerable`1<DotNet.Testcontainers.Configurations.IMount>, System.Collections.Generic.IEnumerable`1<DotNet.Testcontainers.Networks.INetwork>, System.Collections.Generic.IEnumerable`1<System.String>, System.Collections.Generic.IEnumerable`1<System.String>, DotNet.Testcontainers.Configurations.IOutputConsumer, System.Collections.Generic.IEnumerable`1<DotNet.Testcontainers.Configurations.IWaitUntil>, System.Func`3<DotNet.Testcontainers.Containers.IContainer,System.Threading.CancellationToken,System.Threading.Tasks.Task>, System.Nullable`1<Boolean>, System.Nullable`1<Boolean>)'.
   at WireMock.Net.Testcontainers.WireMockConfiguration..ctor(String username, String password)
   at WireMock.Net.Testcontainers.WireMockContainerBuilder..ctor()
   at ../TestFactory.cs:line 22
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

Xunit.Sdk.TestClassException
The following constructor parameters did not have matching fixture data: TestFactory factory
Exception doesn't have a stacktrace

Originally created by @lukasszh on GitHub (Jan 23, 2024). Originally assigned to: @StefH on GitHub. ### Describe the bug After upgrading from .NET 7 to version 8, WireMock cannot be started anymore. ### Test to reproduce - .NET 8.0 - Rancher Desktop - MacOS 14.2.1 - wiremock.net.testcontainers/1.5.46 Once this line is added to the IClassFixture of xUnit, the error message appears. ``` c# private readonly WireMockContainer _wireMockContainer = new WireMockContainerBuilder().WithAutoRemove(true).Build(); ``` With .NET 7 and the same setup, everything worked perfectly fine. ### Stacktrace ``` System.AggregateException One or more errors occurred. (Method not found: 'Void DotNet.Testcontainers.Configurations.ContainerConfiguration..ctor(DotNet.Testcontainers.Images.IImage, System.Func`2<Docker.DotNet.Models.ImageInspectResponse,Boolean>, System.String, System.String, System.String, System.String, System.Collections.Generic.IEnumerable`1<System.String>, System.Collections.Generic.IEnumerable`1<System.String>, System.Collections.Generic.IReadOnlyDictionary`2<System.String,System.String>, System.Collections.Generic.IReadOnlyDictionary`2<System.String,System.String>, System.Collections.Generic.IReadOnlyDictionary`2<System.String,System.String>, System.Collections.Generic.IReadOnlyDictionary`2<System.String,DotNet.Testcontainers.Configurations.IResourceMapping>, System.Collections.Generic.IEnumerable`1<DotNet.Testcontainers.Containers.IContainer>, System.Collections.Generic.IEnumerable`1<DotNet.Testcontainers.Configurations.IMount>, System.Collections.Generic.IEnumerable`1<DotNet.Testcontainers.Networks.INetwork>, System.Collections.Generic.IEnumerable`1<System.String>, System.Collections.Generic.IEnumerable`1<System.String>, DotNet.Testcontainers.Configurations.IOutputConsumer, System.Collections.Generic.IEnumerable`1<DotNet.Testcontainers.Configurations.IWaitUntil>, System.Func`3<DotNet.Testcontainers.Containers.IContainer,System.Threading.CancellationToken,System.Threading.Tasks.Task>, System.Nullable`1<Boolean>, System.Nullable`1<Boolean>)'.) (The following constructor parameters did not have matching fixture data: TestFactory factory) Exception doesn't have a stacktrace System.MissingMethodException Method not found: 'Void DotNet.Testcontainers.Configurations.ContainerConfiguration..ctor(DotNet.Testcontainers.Images.IImage, System.Func`2<Docker.DotNet.Models.ImageInspectResponse,Boolean>, System.String, System.String, System.String, System.String, System.Collections.Generic.IEnumerable`1<System.String>, System.Collections.Generic.IEnumerable`1<System.String>, System.Collections.Generic.IReadOnlyDictionary`2<System.String,System.String>, System.Collections.Generic.IReadOnlyDictionary`2<System.String,System.String>, System.Collections.Generic.IReadOnlyDictionary`2<System.String,System.String>, System.Collections.Generic.IReadOnlyDictionary`2<System.String,DotNet.Testcontainers.Configurations.IResourceMapping>, System.Collections.Generic.IEnumerable`1<DotNet.Testcontainers.Containers.IContainer>, System.Collections.Generic.IEnumerable`1<DotNet.Testcontainers.Configurations.IMount>, System.Collections.Generic.IEnumerable`1<DotNet.Testcontainers.Networks.INetwork>, System.Collections.Generic.IEnumerable`1<System.String>, System.Collections.Generic.IEnumerable`1<System.String>, DotNet.Testcontainers.Configurations.IOutputConsumer, System.Collections.Generic.IEnumerable`1<DotNet.Testcontainers.Configurations.IWaitUntil>, System.Func`3<DotNet.Testcontainers.Containers.IContainer,System.Threading.CancellationToken,System.Threading.Tasks.Task>, System.Nullable`1<Boolean>, System.Nullable`1<Boolean>)'. at WireMock.Net.Testcontainers.WireMockConfiguration..ctor(String username, String password) at WireMock.Net.Testcontainers.WireMockContainerBuilder..ctor() at ../TestFactory.cs:line 22 at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) ``` Xunit.Sdk.TestClassException The following constructor parameters did not have matching fixture data: TestFactory factory Exception doesn't have a stacktrace
adam added the bug label 2025-12-29 08:30:17 +01:00
adam closed this issue 2025-12-29 08:30:17 +01:00
Author
Owner

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

https://github.com/WireMock-Net/WireMock.Net/pull/1057

@StefH commented on GitHub (Jan 23, 2024): https://github.com/WireMock-Net/WireMock.Net/pull/1057
Author
Owner

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

@lukasszh
I did test it in my Windows machine using Windows and Linux Docker, and .NET6, 7 & 8 work fine.

@StefH commented on GitHub (Jan 23, 2024): @lukasszh I did test it in my Windows machine using Windows and Linux Docker, and .NET6, 7 & 8 work fine.
Author
Owner

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

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

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

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

@lukasszh
Are you also using TestContainers version 3.7.0 ?

@StefH commented on GitHub (Jan 24, 2024): @lukasszh Are you also using TestContainers version 3.7.0 ?
Author
Owner

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

@lukasszh
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): @lukasszh 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

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

@StefH: Thank you for the quick problem analysis!

After some further problem analysis, I found out that it is also related to the compatibility with TestContainers 3.7.0. Using your fix 1.5.46-ci-18317 has solved my problem.

@lukasszh commented on GitHub (Jan 25, 2024): @StefH: Thank you for the quick problem analysis! After some further problem analysis, I found out that it is also related to the compatibility with TestContainers 3.7.0. Using your fix 1.5.46-ci-18317 has solved my problem.
Author
Owner

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

Thanks for confirming.

I'll release a new official NuGet today.

@StefH commented on GitHub (Jan 25, 2024): Thanks for confirming. 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#565