Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
lukasszh opened this issue Jan 23, 2024 · 7 comments
Closed
Assignees
Labels

Comments

@lukasszh
Copy link

lukasszh commented Jan 23, 2024

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

@lukasszh lukasszh added the bug label Jan 23, 2024
@StefH StefH self-assigned this Jan 23, 2024
@StefH
Copy link
Collaborator

StefH commented Jan 23, 2024

#1057

@StefH
Copy link
Collaborator

StefH commented Jan 23, 2024

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

@StefH
Copy link
Collaborator

StefH commented Jan 24, 2024

#1059

@StefH StefH changed the title "Method not found" after upgrading to dotnet version 8 WireMock.Net 1.5.46 is incompatible with TestContainers 3.7.0 (issue 1) Jan 24, 2024
@StefH
Copy link
Collaborator

StefH commented Jan 24, 2024

@lukasszh
Are you also using TestContainers version 3.7.0 ?

@StefH StefH changed the title WireMock.Net 1.5.46 is incompatible with TestContainers 3.7.0 (issue 1) "Method not found" after upgrading to dotnet version 8 Jan 24, 2024
@StefH
Copy link
Collaborator

StefH commented 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

@lukasszh
Copy link
Author

lukasszh commented 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.

@StefH StefH changed the title "Method not found" after upgrading to dotnet version 8 WireMock.Net 1.5.46 is incompatible with TestContainers 3.7.0 (issue 1) Jan 25, 2024
@StefH
Copy link
Collaborator

StefH commented Jan 25, 2024

Thanks for confirming.

I'll release a new official NuGet today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants