When Teamcity runs an integration test that starts a self-hosted webapplication, the test fails with the error:
System.MissingMemberException: The server factory could not be located for the given input: Microsoft.Owin.Host.HttpListener
The code throwing this error is:
var webApp = WebApp.Start<Startup>("http://*:52203/")
The test runs fine when executed withing Visual Studio (using the Resharper test runner). Teamcity is configured to use the JetBrains.BuildServer.NUnitLauncher.exe
executable to run the test.
I see a lot of posts regarding this error are to do with the because the Microsoft.Owin.Host.HttpListener.dll
is not present in the bin\debug or bin\release folder. I can confirm that this file (and the accompanying .xml file) are both present in the bin\release folder used by the TeamCity buildAgent. There is no bin\debug folder present.