简体   繁体   English

对于自托管SignalR,我有哪些选择?

[英]What are my options for self-hosting SignalR?

I want to add SignalR to my Windows service, written in C#, targetting .NET 4.0. 我想将SignalR添加到以C#编写的Windows服务中,以.NET 4.0为目标。 The Microsoft.Owin.* packages appear to require .NET 4.5. Microsoft.Owin.*软件包似乎需要.NET 4.5。

I'd also like to include NancyFX in the same process, for other reasons. 由于其他原因,我也想在同一过程中加入NancyFX。

What's the best way to self-host SignalR? 自托管SignalR的最佳方法是什么?

I installed the signalR package (v. 1.1.2) using .net 4.0. 我使用.net 4.0安装了signalR软件包(1.1.2版)。 Work as a charm. 发挥魅力。 I cannot use 4.5 as I am still at VS2010. 我无法使用4.5,因为我仍在VS2010。

I use it with a standard web project with a WebService handling the communication. 我将其用于具有WebService处理通信的标准Web项目。

唯一需要4.5的Microsoft OWIN软件包是owinhost.exe(以前是katana.exe),您仍然可以使用普通的HTTP侦听器(Microsoft.Owin.Host.HttpListener)来自托管。

If you install the packages as listed at https://github.com/SignalR/SignalR/wiki/Self-host they should work just fine under .NET 4.0. 如果您按照https://github.com/SignalR/SignalR/wiki/Self-host上列出的方式安装软件包,则它们在.NET 4.0下应该可以正常工作。 It's worth remembering that you can always use the package manager console to explicitly install older versions of packages if you need to - although for SignalR at the time of writing there is no need to do this. 值得记住的是,如果需要,您始终可以使用软件包管理器控制台显式安装较旧版本的软件包-尽管在编写本文时对于SignalR而言,不需要这样做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM