Hi @Net Wang
I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this!
Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.
Issue :
Windows Desktop UI App (SignalR Client 2) in .NET Framework 4.8** is failing to establish a SignalR connection with your .NET Core 8 SignalR Server, while other clients (ASP.NET 4.8
and JavaScript) are able to connect successfully.
The problem occurs when calling:
await Connection.StartAsync();
Solution :
solved the issue by embedding in a new Task which is different from Windows Form UI thread
Run StartAsync()
on a separate Task to avoid blocking the UI thread:
Task.Factory.StartNew(() =>
{
await Connection.StartAsync();
});
Please click Accept Answer and kindly upvote it so that other people who faces similar issue may get benefitted from it.