0

I am trying out Server-side Blazor (.net core 3.0 Preview 5). I have been searching the web but can't seem to find an answer. I really like the "layout" of the Blazor (ASP.NET Core hosted) template (see image below). The client part of that is WebAssebly. But I read someware that I could change blazor.webassembly.js to blazor.server.js and that it would be it. How ever that doesn't work. I get some errors in the console log:

Error: Failed to complete negotiation with the server: Error: Internal Server Error blazor.server.js:1

Error: Cannot send data if the connection is not in the 'Connected' State. blazor.server.js:1

What do I need to do for the client to use blazor.server.js instead of blazor.webassembly.js?

Or have I just misunderstood everything?

Blazor templates

1 Answer 1

2

You are not consistent in describing what flavor of Blazor you're using. I'm going to provide you the code below of how to implement Blazor dual mode, but not without warning that though shifting from Blazor client side to Blazor server side, in configuration term is made simple by a developer named Suchiman, coding for the client can be very different than coding for the server, and you should know what you're doing and take into account many factors...

Here's the link that instruct you how to move to and forth: https://github.com/Suchiman/BlazorDualMode

Please don't hesitate to ask any question about the above. Next time select the blazor tag. I've got to this section by mere chance. The Blazor section is very active...

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for the reply. From Preview 5 it doesn't seem to work. I have tried different ways with Suchimans implementation but haven't gotten it to work. I found this (github.com/aspnet/AspNetCore/issues/9747) answer to a similar question so I guess that the template I wanted to use won't work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.