Same Code working on Blazor Server side for a simple Chat, doenst work on Blazor Client side.
Just calling the "app" getting several errors in F12 command like
WASM: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DllNotFoundException: libc assembly:
as I can not debug (also shift alt D in chrome) my guess is happens here
protected override async Task OnInitAsync()
{
connection = new HubConnectionBuilder()
.WithUrl("https://signalrdemo2220190428112854.azurewebsites.net/ChatDemoHub")
.Build();
await connection.StartAsync();
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.0.0-preview4-19216-03" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.0.0-preview4-19216-03" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.DevServer" Version="3.0.0-preview4-19216-03" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="3.0.0-preview4-19216-03" />
I didn't expect the .NET client of SignalR to work on Server-side Blazor that well...
However, on client-side Blazor, you're operating completely in the browser so you need to use the javascript client of SignalR and interop with it in your .NET code. At least, that's what I'd expect.
I didn't expect the .NET client of SignalR to work on Server-side Blazor
sorry to say that clear, what you expect doenst matter for me and solution seekers. btw your are wrong.
Hi @hannespreishuber,
The SignalR client isn't supported yet on client-side Blazor due at least in part to it's dependency on WebSocket support in the runtime, which we haven't enabled yet. There have been some community efforts to get it to work that you can take a look at:
Since we're tracking enabling WebSockets in the runtime separately, I'm going to go ahead and close this issue.
@danroth27 https://github.com/danroth27/BlazorChat/blob/master/BlazorApp1/Program.cs Looks like Client without Blazorextensions?
Since we're tracking enabling WebSockets in the runtime separately, I'm going to go ahead and close this issue.
@danroth27 if it's not to much to ask, any chance you could link to that issue?
@mattferderer No trouble at all 馃槃
WebSockets support has already been implemented for mono.wasm: https://github.com/mono/mono/issues/9567.
To enable this support in Blazor we need to move to the mono bindings. We've been tracking that internally, but I just filed https://github.com/aspnet/AspNetCore/issues/10489 to track it on GitHub.
How far are we from releasing this? As far I can see, all related issues are closed.
We're getting close. There's still some work to do on the .NET runtime side to make sure all the .NET Standard APIs used by the .NET SignalR client are supported and functioning appropriately. This should happen as part of the upcoming Blazor WebAssembly release.
If you use the latest nightlies and only use LongPolling then the .NET client should be working.
Most helpful comment
@mattferderer No trouble at all 馃槃
WebSockets support has already been implemented for mono.wasm: https://github.com/mono/mono/issues/9567.
To enable this support in Blazor we need to move to the mono bindings. We've been tracking that internally, but I just filed https://github.com/aspnet/AspNetCore/issues/10489 to track it on GitHub.