WireMock WebApplication example doesn't run on Net Core 3.1 #300

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

Originally created by @tomatualus on GitHub (Oct 1, 2020).

Describe the bug

When i change the Net Core versions in the [https://github.com/WireMock-Net/WireMock.Net/tree/master/examples/WireMock.Net.WebApplication](WebApplication example), i a Service Unavailable error message on the website and that's all.

Expected behavior:

Changing to Net Core 3.1 version should not produce any errors, or if it does, please make a working example.

Originally created by @tomatualus on GitHub (Oct 1, 2020). ### Describe the bug When i change the Net Core versions in the [https://github.com/WireMock-Net/WireMock.Net/tree/master/examples/WireMock.Net.WebApplication](WebApplication example), i a Service Unavailable error message on the website and that's all. ### Expected behavior: Changing to Net Core 3.1 version should not produce any errors, or if it does, please make a working example.
adam added the question label 2025-12-29 15:20:12 +01:00
adam closed this issue 2025-12-29 15:20:12 +01:00
Author
Owner

@tomatualus commented on GitHub (Oct 1, 2020):

Well, somehow i got it going. I have no idea what did i do, but the last thing i did was in web.config change hostingModel value to "outofprocess"

@tomatualus commented on GitHub (Oct 1, 2020): Well, somehow i got it going. I have no idea what did i do, but the last thing i did was in web.config change hostingModel value to "outofprocess"
Author
Owner

@StefH commented on GitHub (Oct 1, 2020):

Hello @tomatualus,
I did add a new Net Core 3.1 project (https://github.com/WireMock-Net/WireMock.Net/tree/master/examples/WireMock.Net.WebApplication.NETCore3) which seems to run fine, except that I cannot get the logging to work. Maybe you have an idea?

@StefH commented on GitHub (Oct 1, 2020): Hello @tomatualus, I did add a new Net Core 3.1 project (https://github.com/WireMock-Net/WireMock.Net/tree/master/examples/WireMock.Net.WebApplication.NETCore3) which seems to run fine, except that I cannot get the logging to work. Maybe you have an idea?
Author
Owner

@tomatualus commented on GitHub (Oct 2, 2020):

Hey @StefH,

Logger in WireMockService must be a ILogger<WireMockService>

And in ConfigureServices you must call serviceCollection.AddLogging(x => x.AddConsole()); for it to be added to DI setup. Hope that works.

@tomatualus commented on GitHub (Oct 2, 2020): Hey @StefH, Logger in `WireMockService` must be a `ILogger<WireMockService>` And in ConfigureServices you must call `serviceCollection.AddLogging(x => x.AddConsole());` for it to be added to DI setup. Hope that works.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#300