当我尝试启动时:
WebApp.Start<SrvcHst>(new StartOptions { Port = 9956,
ServerFactory = "Microsoft.Owin.Host.HttpListener" });
我遇到了以下异常。可能的根本原因是什么?
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)
Microsoft.Owin.Host.HttpListener.dll
,并与主程序集放置在同一目录下?或者你可以将其作为项目引用添加,并将其复制到 bin 目录中。 - Marcel N.