SignalR support in .NET 4

2019-01-17 04:14发布

问题:

Does SignalR support .NET 4.0. Or is it support only from .NET 4.5 upwards. Is there any link which provides with minimum requirements for SignalR.

回答1:

This is not the case any more, and the 2.x releases require .NET 4.5. https://github.com/SignalR/SignalR/issues/1723



回答2:

The last .NET 4.0 support for SignalR is version 1.2.2. Version 2 only works with .NET 4.5

Open the NuGet Package Manager Console and type:

Install-Package Microsoft.AspNet.SignalR.Client -Version 1.2.2
Install-Package Microsoft.AspNet.SignalR -Version 1.2.2 

This will install the SignalR (Client and Server) in your selected project (web project) automatically.



回答3:

Yes .NET 4.0 supports SignalR. The minimum requirements:

*Visual Studio 2010 SP1

*Since template installer is not available in VS2010 you need to install SignalR NuGet package



回答4:

One thing to watch here is client/server .Net versions.

Most people know (but it's worth repeating) signalR can be hosted on Windows 2008R2 upwards. Windows 2008R2 has IIS7 and thus when hosted on IIS7 signalR cannot use WebSockets (as the old Windows http stack has no support for WebSockets). So that's ServerSentEvents or LongPolling. Not great for performance.

Windows 2012 upwards (and thus at least IIS8) offers support for WebSockets, which gets the amaziong C10K perf we're all after.

Now the interesting bit.

.NET clients.

If you only care about the browser skip this bit.

Any .Net clients that connect to a signalR back-end MUST use Windows8 upwards to use WebSockets The Microsoft networking stack (for .Net) in Windows7 does not contain WebSockets.

So don't use signalR with WebSockets if your client is Windows7.

OR... like us you'll need to use a custom WebSocket stack coupled with WebClient to handle the http handshake.

Hopefully this will help someone else!



回答5:

You can download entire web stack from codeplex and SignalR from github and compile it under .net4.0



回答6:

There is one sample project at http://www.bluelemoncode.com/2013/02/default.aspx

It is good SignalR sample and working vs 2010 sp1 and .net framework 4.0. working properly.

http://www.bluelemoncode.com/file.axd?file=2013%2f3%2fSignalR_OneOneChat.zip



回答7:

The minimum requirements for SignalR is described here,

Which means your client can be WinForm/WPF application running on Windows XP.