SignalR and SelfHosting ASPNet app

冷暖自知 提交于 2019-12-12 02:42:50

问题


I have an ASPnet webapplication that uses SignalR, it works fine under IIS.

When I try to self host the ASP.NET webapplication with System.Web.ApplicationHost.CreateApplicationHost, The signalR functionality is gone.

From debugging, I see that the OWin Startup class is never hit.

Does anyone have a clue why? From what I understand, the CreateApplicationHost is just hosting the application outside of IIS, but it still runs through the ASP.NET pipeline, So, I don't understand why Owin startup and SignalR wont work.


回答1:


When hosted inside of ASP.NET, OWIN-based applications require the IIS integrated pipeline. CreateApplicationHost forces use of the ASP.NET classic pipeline.

If you want to self-host, use the HttpListener-based OWIN host rather than trying to self-host ASP.NET directly.




回答2:


For instructions on self-hosting SignalR, see the following tutorial:

http://www.asp.net/signalr/overview/signalr-20/getting-started-with-signalr-20/tutorial-signalr-20-self-host



来源:https://stackoverflow.com/questions/20935502/signalr-and-selfhosting-aspnet-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!