Port where WireMockServer listens to - v1.2x #259

Closed
opened 2025-12-29 15:19:15 +01:00 by adam · 8 comments
Owner

Originally created by @paolopiaggio on GitHub (Mar 25, 2020).

Hello, since version 1.2.0 it looks like the WireMockServer starts listening on a random port instead of the one specified in the settings.

it seems the issue happens with all the different .Start overload methods.

Originally created by @paolopiaggio on GitHub (Mar 25, 2020). Hello, since version 1.2.0 it looks like the WireMockServer starts listening on a random port instead of the one specified in the settings. it seems the issue happens with all the different .Start overload methods.
adam added the bug label 2025-12-29 15:19:15 +01:00
adam closed this issue 2025-12-29 15:19:15 +01:00
Author
Owner

@StefH commented on GitHub (Mar 25, 2020):

Do you use .NET Framework version ? Or .NET Core ?

And can you provide the start command you use?

@StefH commented on GitHub (Mar 25, 2020): Do you use .NET Framework version ? Or .NET Core ? And can you provide the start command you use?
Author
Owner

@StefH commented on GitHub (Mar 25, 2020):

This seems a bug, I've to investigate more.

As a workaround you can provide the url, that works.

@StefH commented on GitHub (Mar 25, 2020): This seems a bug, I've to investigate more. As a workaround you can provide the `url`, that works.
Author
Owner

@paolopiaggio commented on GitHub (Mar 25, 2020):

I am using .NET Core 2.2

I tried these 2 methods:

WireMockServer.Start(port: {portNumber})

WireMockServer.Start(new WireMockServerSettings
{
    Port = {portNumber}
}
@paolopiaggio commented on GitHub (Mar 25, 2020): I am using .NET Core 2.2 I tried these 2 methods: ``` WireMockServer.Start(port: {portNumber}) WireMockServer.Start(new WireMockServerSettings { Port = {portNumber} } ```
Author
Owner

@StefH commented on GitHub (Mar 25, 2020):

You can try preview NuGet : WireMock.Net.1.2.1-ci-13017

@StefH commented on GitHub (Mar 25, 2020): You can try preview NuGet : WireMock.Net.1.2.1-ci-13017
Author
Owner

@paolopiaggio commented on GitHub (Mar 25, 2020):

Hi @StefH , thanks for the prompt replies : )

I still don't see the WireMock.Net.1.2.1-ci-13017 prerelease package available.

I confirm that specifying the URL including the port does work.

@paolopiaggio commented on GitHub (Mar 25, 2020): Hi @StefH , thanks for the prompt replies : ) I still don't see the WireMock.Net.1.2.1-ci-13017 prerelease package available. I confirm that specifying the URL including the port does work.
Author
Owner

@StefH commented on GitHub (Mar 25, 2020):

It's on MyGet ; https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions

@StefH commented on GitHub (Mar 25, 2020): It's on MyGet ; https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions
Author
Owner

@paolopiaggio commented on GitHub (Mar 25, 2020):

uh sorry...I missed that.

Yup, the issue looks fixed in here: WireMock.Net.1.2.1-ci-13017 👍

I tested again with the prerelease package WireMock.Net.1.2.1-ci-13017 and it work just specifying the port either with:

WireMockServer.Start(port: {portNumber})

WireMockServer.Start(new WireMockServerSettings
{
    Port = {portNumber}
}
@paolopiaggio commented on GitHub (Mar 25, 2020): uh sorry...I missed that. Yup, the issue looks fixed in here: WireMock.Net.1.2.1-ci-13017 👍 I tested again with the prerelease package WireMock.Net.1.2.1-ci-13017 and it work just specifying the port either with: ``` WireMockServer.Start(port: {portNumber}) WireMockServer.Start(new WireMockServerSettings { Port = {portNumber} } ```
Author
Owner

@StefH commented on GitHub (Mar 25, 2020):

OK. Closing issue, a new 1.2.2 version will be uploaded to normal NuGet in some time...

@StefH commented on GitHub (Mar 25, 2020): OK. Closing issue, a new 1.2.2 version will be uploaded to normal NuGet in some time...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#259