Invalid Cast Exception #243

Closed
opened 2025-12-29 15:18:57 +01:00 by adam · 1 comment
Owner

Originally created by @kashifsoofi on GitHub (Jan 21, 2020).

I am getting

System.InvalidCastException: 'Unable to cast object of type 'WireMock.Settings.WireMockServerSettings' to type 'WireMock.Settings.FluentMockServerSettings'.'

When running StandAloneApp with following method

public static WireMockServer Start([NotNull] string[] args, [CanBeNull] IWireMockLogger logger = null)

The error is on line 41 of StandAloneApp.cs

var settings = (FluentMockServerSettings) WireMockServerSettingsParser.ParseArguments(args);
Originally created by @kashifsoofi on GitHub (Jan 21, 2020). I am getting ``` System.InvalidCastException: 'Unable to cast object of type 'WireMock.Settings.WireMockServerSettings' to type 'WireMock.Settings.FluentMockServerSettings'.' ``` When running `StandAloneApp` with following method ``` public static WireMockServer Start([NotNull] string[] args, [CanBeNull] IWireMockLogger logger = null) ``` The error is on line 41 of `StandAloneApp.cs` ``` var settings = (FluentMockServerSettings) WireMockServerSettingsParser.ParseArguments(args); ```
adam added the bug label 2025-12-29 15:18:57 +01:00
adam closed this issue 2025-12-29 15:18:58 +01:00
Author
Owner

@StefH commented on GitHub (Jan 22, 2020):

Thanks.

I'll make a new NuGet + Docker image later today.

@StefH commented on GitHub (Jan 22, 2020): Thanks. I'll make a new NuGet + Docker image later today.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#243