Angular-CLI Template - WebSocket Exception #212

Closed
opened 2025-08-09 17:15:25 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @bennettfactor on 1/24/2018

When running the Angular template in version Microsoft.DotNet.Web.Spa.ProjectTemplates.2.0.0-rc1-final I am getting the following exception:

System.PlatformNotSupportedException: The WebSocket protocol is not supported on this platform. at System.Net.WebSockets.WebSocketValidate.ThrowPlatformNotSupportedException() at System.Net.WebSockets.WebSocketHandle.CheckPlatformSupport() at System.Net.WebSockets.ClientWebSocket..ctor() at Microsoft.AspNetCore.SpaServices.Extensions.Proxy.SpaProxy.<AcceptProxyWebSocketRequest>d__8.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.SpaServices.Extensions.Proxy.SpaProxy.<PerformProxyRequest>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Builder.SpaProxyingExtensions.<>c__DisplayClass2_0.<<UseProxyToSpaDevelopmentServer>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.<Invoke>d__7.MoveNext()

Steps to reproduce:

  1. dotnet new --install Microsoft.DotNet.Web.Spa.ProjectTemplates::2.0.0-rc1-final
  2. dotnet new angular
  3. Run "npm install" in the ClientApp directory
  4. dotnet run
  5. Observe exception will occur in the console when you navigate to the URL
  6. Chrome Developer Tools will show 500 Internal Server Error on the websocket request.

This issue was also raised here:
https://github.com/aspnet/JavaScriptServices/issues/1288#issuecomment-346019265

*Originally created by @bennettfactor on 1/24/2018* When running the Angular template in version `Microsoft.DotNet.Web.Spa.ProjectTemplates.2.0.0-rc1-final` I am getting the following exception: `System.PlatformNotSupportedException: The WebSocket protocol is not supported on this platform. at System.Net.WebSockets.WebSocketValidate.ThrowPlatformNotSupportedException() at System.Net.WebSockets.WebSocketHandle.CheckPlatformSupport() at System.Net.WebSockets.ClientWebSocket..ctor() at Microsoft.AspNetCore.SpaServices.Extensions.Proxy.SpaProxy.<AcceptProxyWebSocketRequest>d__8.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.SpaServices.Extensions.Proxy.SpaProxy.<PerformProxyRequest>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Builder.SpaProxyingExtensions.<>c__DisplayClass2_0.<<UseProxyToSpaDevelopmentServer>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.<Invoke>d__7.MoveNext()` Steps to reproduce: 1) dotnet new --install Microsoft.DotNet.Web.Spa.ProjectTemplates::2.0.0-rc1-final 2) dotnet new angular 2) Run "npm install" in the ClientApp directory 3) dotnet run 4) Observe exception will occur in the console when you navigate to the URL 5) Chrome Developer Tools will show 500 Internal Server Error on the websocket request. This issue was also raised here: https://github.com/aspnet/JavaScriptServices/issues/1288#issuecomment-346019265
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#212
No description provided.