Open v-sherryfan opened 2 months ago
Others have reported that websockets dont work as well.
I have the same issue, when my app tries to use websockets it crashes the webhost:
info: Aspire.Hosting.DistributedApplication[0]
Login to the dashboard at https://localhost:17130/login?t=1219810f5d5e68bb166763b068b674a9
info: Aspire.Hosting.DistributedApplication[0]
Distributed application started. Press Ctrl+C to shut down.
C:\Users\nicol\source\repos\MyApp\MyApp.AppHost\bin\Debug\net8.0\MyApp.AppHost.exe (processus 5872) s'est terminé avec le code -1 (0xffffffff).
Sometimes it works but the socket is disconnected in the middle:
System.Net.WebSockets.WebSocketException (0x80004005): The WebSocket is in an invalid state ('Aborted') for this operation. Valid states are: 'Open, CloseReceived, CloseSent'
at System.Net.WebSockets.WebSocketValidate.ThrowIfInvalidState(WebSocketState currentState, Boolean isDisposed, WebSocketState[] validStates)
at System.Net.WebSockets.ManagedWebSocket.CloseAsync(WebSocketCloseStatus closeStatus, String statusDescription, CancellationToken cancellationToken)
--- End of stack trace from previous location ---
at MyApp.API.FileUploadController.Get(HttpContext cont, CancellationToken cancellationToken) in C:\Users\nicol\source\repos\MyApp\MyApp.Web\API\FileUpload\FileUploadController.cs:line 156
at Microsoft.AspNetCore.Http.RequestDelegateFactory.ExecuteTaskResult[T](Task`1 task, HttpContext httpContext)
at Program.<>c__DisplayClass0_0.<<<Main>$>b__2>d.MoveNext() in C:\Users\nicol\source\repos\MyApp\MyApp.Web\Program.cs:line 167
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
It works just fine when run the app without the apphost
REGRESSION INFO: Also repro on main branch (Aspire 8.0 P7)
INSTALL STEPS
REPRO STEPS
release/8.0
branchACTUAL
Workaround
NOTE
EXPECTED