mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 22:30:41 +01:00
C# Unit test: Wiremock Server runs but does not deliver response #600
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @elijah-ezaga on GitHub (May 17, 2024).
Originally assigned to: @StefH on GitHub.
Hi Wiremock.Net Team. I am new to using Wiremock.NET (v1.5.53, the latest) and trying to get it to work with a simple setup but its server does not deliver any response. For context, I have a simple C# Unit test file in a project (.NET Framework 461) with the following contents:
When I run the test, I get the error:
Also If I add a line like
await Task.Delay(TimeSpan.FromMinutes(5))to pause execution and I make requests from Postman for admin URLs like__admin/mappings, it waits endlessly until the time exceeds and the test runs out and it doesn't get a response. However, I can confirm from a Windows command prompt, runningnetstat -ab, that the port is opened and the test process is listening for requests.Any clues what might be wrong ?
@StefH commented on GitHub (May 18, 2024):
Can you please give the complete test project?
@elijah-ezaga commented on GitHub (May 21, 2024):
Hi Stef. Thanks for offering to help.
While I was preparing the project to attach here, I found the issue and was able to fix it. It was connected with libraries in the project depending on 2 different versions of
System.Memoryleading toI got it fixed by using binding redirect in
app.configas the project type was a non-cross-platform .NET Framework test project type.Later I re-created the project to be a cross-platform NUnit test project and there was no longer need for the binding redirect.