-
-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WireMock.Net will not run with certain .net5 dependencies installed in the project #577
Comments
I will try to nail down which of these dependencies that cause the issue. But if anyone have an idea it would be a welcome way to speed up the process. |
Do you have same issue with lower versions from Microsoft.Extensions? |
No. I'm not sure exactly which version that introduce the issue but we were on 3.1.8.0 before we had to upgrade and then it worked. But considering 3.1.11.0 is the last version before 5.0.0.0 it seems likely it's 5.0.0.0 that cause the issue. I just very confused to how it would cause a null ref in the kestrel pipeline. Is there any way to force WireMock to use the old Owin pipeline to see if it works better? |
I never tried using WireMock in .net 5.0 It could be that indeed some Owing pipeline functionality is changed / obsolete / broken. |
The root cause is likely related to this: However, I could not find a way yet to fix this in WireMock.Net Can't you move your unit test project to .net 5 or 3.1 ? |
@StefH Going to 3.1 and then 5 is what we are doing and why we needed to upgrade those dependencies. The problem is that our project is a bit too large to update in one go so we need to take it in steps. And sadly this needs to be the next step. Is it possible to force it using the old Owin host somehow? Otherwise we can probably fork the repo and hard code it to use that one while getting past this period. |
Hello @MikaelEliasson Maybe adding a .NET 4.7.2 framework target to WireMock.Net could help using the correct OWIN implementation, I'll take a look tonight. Another work-around is maybe adding manually a |
I've created a preview version on MyGet (WireMock.Net.1.4.2-ci-14604), can you try this one? |
I seem to be having a similar issue in dotnet core. I'm getting the following error when starting the server:
My dotnet info:
|
@StefH I tried the latest |
In my example project : https://github.com/WireMock-Net/WireMock.Net/tree/net5-issue/examples/WireMock.Net.Console.Net472.Classic adding a However this last issue seems be a different one. Can you also create a example project for this please? |
@StefH it seems my issue is caused by nunit.engine package which might be overwriting a dependency that wiremock.net uses. When i uninstall the nunit.engine package it works |
Describe the bug
When running on .net 4.7.2 and with the Microsoft.Extensions.* packages being upgraded to 5.0.0.0 WireMock will crash on even the simplest calls.
The caller then gets the following exception
Expected behavior:
I expect the call to go through and return the response.
Test to reproduce
Repro code: https://github.com/bokio/WireMockExperiment
The exceptions thrown is:
You can see it if you put the breakpoint in https://github.com/bokio/WireMockExperiment/blob/master/Class1.cs#L55
I tested to install WireMock 1.4.2.0 in the 4.7.2 project without upgrading any libraries and then it worked. So it has to be one of the following dependencies. Because these were the ones we upgraded when we first saw the problem.
Other related info
The test project is a simplification of what happened in our real project where we have Wiremock installed in .netstandard2.0 project and run the tests in 4.7.2. But as shown it becomes the same on 4.7.2.
The text was updated successfully, but these errors were encountered: