mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 22:30:41 +01:00
Question: Why the Microsoft.Owin.Host.HttpListener is not referenced in the dll, which uses WireMock? #105
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @o7g8 on GitHub (May 17, 2018).
Hello,
I know it's not WireMock's fault, but maybe someone may shed a light to the weird situation described here https://stackoverflow.com/questions/30050588/system-missingmemberexception-the-server-factory-could-not-be-located-startin
I have faced the issue myself: UTs using the WireMock execute fine in VisualStudio but fail in command line and on the CI server.

The UT project has the full bunch of references, Owin included, as expected:
But the resulting dll has only few of the references (the picture is taken from dotPeek):

It's so weird, why not all the references from VS are there?
Here are the references of the WireMock.dll itself:
I wonder if the WireMock code can ensure that
Microsoft.Owin.Host.HttpListeneris referenced by the theWireMock.dll? In this case consumers of WireMock won't get the nasty Ut crashes and won't need to add the ugly workaround code in UTs.BTW the workaround with
typeof(OwinHttpListener)works and the UT dll gets theMicrosoft.Owin.Host.HttpListenerin its References.@StefH commented on GitHub (May 18, 2018):
I noticed this issue also, so for my example
net452console app, I did add this reference, see https://github.com/WireMock-Net/WireMock.Net/blob/master/examples/WireMock.Net.ConsoleApplication/packages.config#L4I think there was a reason why I did not add this library to the
WireMockandWireMock.StandAloneprojects. I'll investigate further...@o7g8 commented on GitHub (May 18, 2018):
Unfortunately the explicit NuGet dependency (neither in projects consuming WireMock nor in WireMock itself) doesn't solve the issue. At least for my project which is
net46.@StefH commented on GitHub (May 19, 2018):
I've added information to the WIKI:
https://github.com/WireMock-Net/WireMock.Net/wiki/WireMock-as-a-standalone-process#workaround-for-microsoftowinhosthttplistener-exception