Cannot use WireMockServerSettings instance with URL specified #477

Closed
opened 2025-12-29 15:24:41 +01:00 by adam · 2 comments
Owner

Originally created by @williambowsher-omnio on GitHub (Dec 21, 2022).

Originally assigned to: @StefH on GitHub.

I am trying to instantiate a WireMockServer using the WireMockServerSettings with a URL specified as below:

var settings = new WireMockServerSettings
{
    Urls = new[] { "http://+:6010/statement-databridge/v1/" }
};
_server = WireMockServer.Start(settings);

But every time I inspect the _server object, it has what appear to be 2 default URLS configured at ports 5000 and 5001.
I am using WireMock.NET 1.5.13

Could you provide any pointers about what I am doing wrong

Originally created by @williambowsher-omnio on GitHub (Dec 21, 2022). Originally assigned to: @StefH on GitHub. I am trying to instantiate a WireMockServer using the WireMockServerSettings with a URL specified as below: ``` c# var settings = new WireMockServerSettings { Urls = new[] { "http://+:6010/statement-databridge/v1/" } }; _server = WireMockServer.Start(settings); ``` But every time I inspect the _server object, it has what appear to be 2 default URLS configured at ports 5000 and 5001. I am using WireMock.NET 1.5.13 Could you provide any pointers about what I am doing wrong
adam added the question label 2025-12-29 15:24:41 +01:00
adam closed this issue 2025-12-29 15:24:42 +01:00
Author
Owner

@StefH commented on GitHub (Dec 21, 2022):

@williambowsher-omnio
You cannot provide the full url.

WireMockServer always runs at the root - url.

Can you try:

var settings = new WireMockServerSettings
{
    Urls = new[] { "http://+:6010" }
};
_server = WireMockServer.Start(settings);
@StefH commented on GitHub (Dec 21, 2022): @williambowsher-omnio You cannot provide the full url. WireMockServer always runs at the _root_ - url. Can you try: ``` c# var settings = new WireMockServerSettings { Urls = new[] { "http://+:6010" } }; _server = WireMockServer.Start(settings); ```
Author
Owner

@williambowsher-omnio commented on GitHub (Dec 21, 2022):

Yep that worked, thanks for the fast response.

@williambowsher-omnio commented on GitHub (Dec 21, 2022): Yep that worked, thanks for the fast response.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#477