SignalR and SelfHosting ASPNet app

2019-09-01 04:13发布

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.

2条回答
Deceive 欺骗
2楼-- · 2019-09-01 04:38
老娘就宠你
3楼-- · 2019-09-01 04:45

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.

查看更多
登录 后发表回答