OWIN HttpListener not located

When I try to run:

WebApp.Start<SrvcHst>(new StartOptions { Port = 9956, ServerFactory = "Microsoft.Owin.Host.HttpListener" }); 

I get the following exception. What could be the main reason?

 System.MissingMemberException was caught HResult=-2146233070 Message=The server factory could not be located for the given input: Microsoft.Owin.Host.HttpListener Source=Microsoft.Owin.Hosting StackTrace: at Microsoft.Owin.Hosting.Engine.HostingEngine.ResolveServerFactory(StartContext context) at Microsoft.Owin.Hosting.Engine.HostingEngine.Start(StartContext context) at Microsoft.Owin.Hosting.Starter.DirectHostingStarter.Start(StartOptions options) at Microsoft.Owin.Hosting.Starter.HostingStarter.Start(StartOptions options) at Microsoft.Owin.Hosting.WebApp.StartImplementation(IServiceProvider services, StartOptions options) at Microsoft.Owin.Hosting.WebApp.Start(StartOptions options) at Microsoft.Owin.Hosting.WebApp.Start[TStartup](StartOptions options) 
+65
c # exception owin asp.net-web-api2
Aug 01
source share
4 answers

You must include Microsoft.Owin.Host.HttpListener.dll in your project links.

You can add it through NuGet.

However, if the executable code is:

 WebApp.Start<SrvcHst> (...); 

contained in the class library, make sure that the executable that consumes the library also includes a link to Microsoft.Owin.Host.HttpListener.dll , otherwise it will not be deployed with your program, since there are no explicit links to it from the class library.

Look at your bin/Debug folder and make sure there is a DLL there.

+116
Nov 13 '14 at 5:51
source

Make sure you have Microsoft.Owin.Host.HttpListener installed

To install the package, use this command line:

 Install-Package Microsoft.Owin.Host.HttpListener 
+42
Jul 12 '15 at 16:13
source

Sometimes NuGet links are added in an incomplete state. If you have the packages installed, but the links are not included, try reinstalling them through:

 Update-Package -reinstall 

in the package manager console.

+6
Mar 16 '15 at 16:06
source

A small addition to Pierre and Damit. If you are using Mac OS , run the following command to install the HttpListener :

 dnu install Microsoft.Owin.Host.HttpListener 
+1
Jan 11 '16 at 4:01
source



All Articles