I build an application using HttpClient using .Net 4.5 Framework, but later I realized the clients machine is Windows Server 2003 which does not support .Net 4.5, so what are my options?
rewrite the application using HttpWebRequest? or, is there a better alternative?
Related
I used Socket.io on Node on and I like it.
I would like to use SignalR. But I heard WebSocket is not supported on Windows 7, which I use. I did some search and seems the reason is that WebSocket uses some Windows lib to handle WebSocket TCP.
But since SignalR is opensource on Github and Websocket is technically possible on Windows 7, I am wondering if there is or could be a fork of SignalR that support WebSocket on Windows 7. If not, is there any technical or legal reason?
WebSockets are not supported in Windows 7 if you are using ASP.NET. The only public implementations of client and server WebSockets are supported on Windows 8 and Windows Server 2012.
Here are the requirements to use websockets:
The WebSocket Protocol was introduced in IIS 8.0.
.NET Framework 4.5
Windows 8 or Windows Server 2012.
I have a relatively simple web application that I am currently porting to asp.net 5. The current version runs under IIS on some Windows 7 and Server 2008 machines.
With the next version of my software I would like to connect a C++ client via SignalR to the web application. The problem is that the current version of the new Signalr-Cpp client only supports SignalR via websockets.
IIS on Windows 7 and Server 2008 does not support websockets, though.
Since a self-hosting solution would be fine for me, my question is:
Is it possible to support Signalr via websockets on Windows 7 / Server 2008 when the web app is self-hosted?
Update:
I would accept
does self hosted signalr require windows server 2012 in order to use websockets? as an answer if there wasn't this small comment by Damian Edwards in the following Tweet by David Fowler which says
although, with v3, websockets in a self-hosted server (like Katana) is possible
Does this change the situation?
Final update
At least with beta 6 it works on Windows 7 when hosting the app with Kestrel and including the middleware Microsoft.AspNet.WebSockets.Server.
It's not possible...
SignalR Supported Platforms
for SignalR to use WebSockets, Windows Server 2012 or Windows 8 is
required
Does self hosted signalr require windows server 2012 in order to use websockets
HTTP.SYS prior to Windows 8/2012 has no built in support for
WebSockets, so although .NET 4.5 contains WebSocket classes, they
won't work unless you are running .NET 4.5+ on Windows 8/2012 and that
will affect self-hosting solutions running in Windows < 8.
UPDATE:
My answer is valid for current release version of SignalR (2.2). Tweets you included (quite old btw) suggest this will be possible in v3 but its not released yet, there is not much info on Internet about changes\features of this release and I even can't find anything about WebSocket support in Katana on Win < 8 in list of Github issues for v3
I installed the SignalR package when our project was running .net 4.0. We since upgraded to 4.5 and I want to support WebSockets. I uninstalled Signal packages and reinstalled SignalR (per this answer). However the SignalR DLL versions (1.1.0/1.1.3) are identical in both cases.
Here is my configuration:
ASP.NET 4.5
IIS 8.0 (Windows Server 2012)
WebSockets feature enabled on the server
A WebSocket supporting browser (latest version of Firefox)
Even though I have all these required things, I still get this:
{"Url":"/signalr","ConnectionToken":"Yy6qHcSMMm4vPl9i3ungxJ5aa2P0SJh4UoU4pelAyFcMud0596UaeB6x8AmhZ2SxW_MPk23QXrKGkwar7LjLLnWlBZx1nokd6LRe96k8D-Oua3kSnKsyDa1RrPTE0n9FyaUO9rK3caLfue20Dmx5UkB9F2TKusPD4PDqQw2","ConnectionId":"b7b00e98-3128-4fbb-ba63-fb16f922f168","KeepAliveTimeout":20.0,"DisconnectTimeout":30.0,"TryWebSockets":false,"WebSocketServerUrl":null,"ProtocolVersion":"1.2"}
I guess the important parts are:
"TryWebSockets":false,"WebSocketServerUrl":null,"ProtocolVersion":"1.2"
Does this mean that I am not using WebSockets? What could I be missing?
Thanks so much.
WebSockets are supported in all major versions of SignalR.
Therefore the question is "what is required for my SignalR application to use WebSockets?"
ASP.NET 4.5
IIS 8.0 (Windows Server 2012 or Windows 8)
WebSockets feature enabled on the server
A WebSocket supporting browser
Now that we've established what is required to have a WebSocket enabled application it seems that your missing the enabling of the WebSockets feature.
To enable WebSockets on your server follow the "Step by Step instructions" here.
Hope this helps!
I know your problem - the same that hit ours!
Your problem is the client you are running from.
The client Windows stack must be > Windows7 to use WebSockets on a
.Net Client
This caught us too!
Browsers aren't affected as they have their own WebSocket stack, but the Windows .Net networking stack doesn't have WebSockets.
Windows 8/Windows 2012 and IIS 8 fixes that.
This is why the SignalR load tester (crank) can't use WebSockets when run on Windows7, only in Windows 2012 (regardless of server)
We since upgraded to 4.5 and I want to support WebSockets.
I'm running Windows 2012 Server, IIS 8, WebSockets feature installed on server and I still get this
Since you are using ASP.NET 4.5, IIS 8 and Windows Server 2012, the problem should be relying on how you migrated the project to .NET framework 4.5 or with the browser. Given that most of the modern web browsers support web sockets, I highly doubt your references are still for the .NET framework 4.0.
Try by creating a new project using .NET framework as 4.5. Simply setting the target using project properties sometimes doesn't update the assemblies.
On my IIS 7.5, my SignalR application always used long polling.
As per my search, IIS 7.5 does not support WebSockets yet.
I hope, I missed some tools or configurations to enable WebSockets in IIS 7.5. Or I didn't?
You cannot use WebSocket on IIS 7.5 (in other words on Windows Server 2008 R2 or Windows 7) because it requires HTTP.sys level changes AFAIK. So, you need IIS 8.0 and Windows Server 2012 or Windows 8 combination to leverage WebSocket. Also, IIS Express 8.0 supports WebSockect, too but you cannot still leverage that if you are on an OS which is lower than Windows 8 or Windows Server 2012.
IIS 8 Express Supports websockets New Features
Windows 7 is considered a Down-Level Operating system and doesn't support Web Sockets. Known Issues and Limitations
Time to upgrade to Windows 8 if you want to support for web-sockets!
Here's a summary of the required setup steps to host on Windows 2008r2 with IIS 7.5:
Update the SignalR application's web.config file to enable "run all managed modules for all requests" (for short, this is the RAMMFAR setting).
Update the web page that uses SignalR to communicate with the server:
Add a reference to the json2.js library.
Add a tag that forces the content to display in a recent browser mode.
Set up a Windows Server 2008r2 with IIS 7.5 as follows:
Install the .NET Framework version that your SignalR application requires.
Create a site and associate it with the appropriate application pool.
Update the Signalr Application's Web.config File
In your SignalR application's web.config file, add the RAMMFAR setting to enable running all managed modules for all requests. This setting was required to get the SignalR sample application running in on Windows 2008r2 and IIS 7.5 in all browsers.
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
</modules>
</system.webServer>
Update the Web Page that Uses SignalR
In the application web page that uses SignalR to communicate with the server, add the following code.
Add a reference to the json2.js JSON parser library. This script provides a JSON parser for previous browser versions that don't have it. You can add the script in one of two ways:
Add the NuGet package json2.js to your project, and then reference it in your web page:
Or as an alternative, reference json2.js on a CDN:
Add the following tag in the head section of the page. This tag, specifically the IE=edge value, forces Internet Explorer to display content in the most recent version available, rather than earlier modes (such as IE7) which prevent SignalR code from working.
Set up Windows Server 2008r2 and IIS 7.5
As noted, I built the sample SignalR application from the Getting Started with SignalR tutorial on .NET 4. This is a common hosting scenario on Windows 2008r2 and IIS 7.5. The server was a new default default installation of Windows Server 2008r2 and IIS 7.5.
Install the required .NET Framework version. In this case I installed .NET Framework 4.
Create a new site in IIS Manager, and associate the site with an application pool. Use integrated mode application pools, classic mode is not supported for SignalR. For this application I used the ASP.NET v4.0 application pool.
After following the above setup steps, I was able to deploy the .NET Framework 4-based version of the Getting Started with SignalR sample to the server, and it worked perfectly in IE (versions 8, 9, and 10), Chrome, and Firefox even though it was using fallback transport methods (forever frames in IE, and server-sent events in the other browsers). The interesting thing for SignalR developers is that apart from the above steps, I didn't have to change a single line of the SignalR code anywhere in the application to make this work.
This is a simple case but shows that SignalR really does support "automatic fallback" to earlier transport mechanisms when websockets support is not available on the server.
I want to start using .NET 4.5 (C# 5.0) in my applications as soon as it is officially released, and am developing applications in Visual Studio 2010 for Windows 7.
I know that the Metro APIs are only available for Windows 8, but are there any other APIs / language features I will be unable to use?
(I am particularly keen to use the async stuff and WCF 4.5.)
Thanks <333
According to Scott Hanselman's video on SignalR (http://www.asp.net/vnext/overview/videos/signalr-and-web-sockets), WebSockets are only supported in IIS8, so SignalR will gracefully downgrade to a supported protocol.
Other than that, I'm not aware of any application features (aside from Metro Apps) that require both Windows8/Server2012 and .NET 4.5.
On the support level, Automatic ngen is a Windows-8-only feature:
http://msdn.microsoft.com/en-us/library/hh691758.aspx
You shouldn't have any problems with async, since that's a threading and compiler feature, and threading-bugs aside, should be platform agnostic.
Regards, Michael