I have been looking for an hour and am baffled why the SignalR sample code actually works! I got it installed from nuget and it just works, which is good but cannot see how.

I cannot see anything in the global.asax or web.config to register the HttpHandler. I suspect this is probably a static constructor in some class and adds the handler (although again with no code using the class, that will not work), but cannot figure out without looking at the code - and for this, I dont feel like going through all the code.

So what have I missed?

Thanks for your help.

有帮助吗?

解决方案

OK, I figured out.

It uses PreApplicationStartMethod assembly attribute to load class Bootstrapper to register the HubModule.


UPDATE

In fact, in the version of samples I have, it is done in PreApplicationStart which is different from the source code that is in the GitHub (they have added support for OWIN, etc hence the loading has been abstracted out to separate hosting assemblies).

其他提示

Download the source code and look for the AspNetHost class.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top