Questions tagged [blazor-client-side]

The client side execution of commands in the browser; apart from the server side code.

Blazor is a web framework designed to run client-side in the browser on a WebAssembly-based .NET runtime (Blazor WebAssembly) or server-side in ASP.NET Core (Blazor Server). Regardless of the hosting model, the app and component models are the same. ASP.NET Core Blazor hosting models

712 questions
56
votes
13 answers

There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'browser-wasm'

Trying to migrate from ASP.NET Core 3.1 to 5.0 using this guide provided by Microsoft. Installed SDK 5.0.100-rc.1 with runtimes. Updated project as guide says and still getting following error: There was no runtime pack for Microsoft.AspNetCore.App…
Kasta
  • 1,724
  • 2
  • 16
  • 22
53
votes
9 answers

Is there any hot reload for blazor server-side?

I have just one, quick question. Is there way to hot reload a blazor app? At least, .razor files? Now I'm hosting my app on local IIS (not IIS express). I was looking through internet, but i didn't found anything helpful. Thank you all for anwsering…
47
votes
11 answers

Blazor redirect to login if user is not authenticated

I am trying to develop an app using Blazor WebAssembly and I am wondering about how I can protect my whole application if the user is not authenticated. The behavior I would implement is: If an anonymous user asks for any page, then he will be…
Leonardo Lurci
  • 2,409
  • 3
  • 18
  • 34
44
votes
9 answers

How to use Bootstrap modal in Blazor client app?

I am trying to show bootstrap modal then bind its buttons. But I cannot pass the first step showing the modal. I am using Blazor client template of .net core 3.1. I have a page named Modal.razor which contains the bootstrap modal I found from…
Sorush
  • 3,275
  • 4
  • 28
  • 42
41
votes
12 answers

Blazor client-side debugging

I noticed that all of my C# breakpoints do not get hit as debugging seems like its disabled for client-side Blazor apps. Is there a way to attach the debugger or enable the debugger somehow? Thanks
AlvinfromDiaspar
  • 6,611
  • 13
  • 75
  • 140
39
votes
5 answers

How can I write into the browser´s console via Blazor WebAssembly?

In JavaScript we can use the following call to write debug output to the browser´s console: console.log("My debug output."); Output in Google Chrome: How can I log "My debug output" in my component to the browser´s console via Blazor…
Simon
  • 4,157
  • 2
  • 46
  • 87
35
votes
7 answers

Found markup element with unexpected name 'Cascading AuthenticationState'

I am getting this error on my App.razor: Found markup element with unexpected name 'CascadingAuthenticationState'. If this is intended to be a component, add a @using directive for it namespace This is the code I am…
Ibanez1408
  • 4,550
  • 10
  • 59
  • 110
25
votes
10 answers

How to acess the appsettings in blazor webassembly

I currentying trying to save the api url in an appsettings. However, the configuration.Propertiers seems to be empty. I am not sure how to get the setting. in program.cs: public static async Task Main(string[] args) { var builder =…
Zo.
  • 260
  • 1
  • 3
  • 10
24
votes
3 answers

How to resolve "TypeError: Failed to fetch" error on Blazor?

I am trying to send an HTTP request from my Blazor app to my ASP.NET Core API. I have breakpoints everywhere. The application gives an exception right after the action method on the API controller returns. I am familiar with .NET overall, however, I…
M. Azyoksul
  • 1,580
  • 2
  • 16
  • 43
21
votes
5 answers

Blazor TwoWay Binding on custom Component

I'm creating a blazor server side app and have problems to bind a value between two custom components. I've looked through different example of how the bind or @bind is supposed to work but I cannot figure out what up to date information on this…
Drew Fyre
  • 558
  • 1
  • 5
  • 9
20
votes
2 answers

How to render a Blazor component into an HTML string

I'm looking for a way to render a Blazor component into an HTML string, so that I'll be able to use it as a templating engine to create and send emails in my web application. Ideas?
20
votes
3 answers

Blazor Component Reference Null on First Render

I have a custom component with an event Action called TabChanged. In my Razor page I set the reference to it up like so: ... @code { private TabSet tabSet; ... } In the OnAfterRenderAsync method I…
INNVTV
  • 3,155
  • 7
  • 37
  • 71
19
votes
2 answers

In Blazor WebAssembly, how to include hash in static file link/script reference in index.html for cache-busting?

In server-side ASP.NET, we can do asp-append-version=true on static assets in a .cshtml file in order to automatically append a hash of the file to the filename. But, in Blazor WebAssembly, this doesn't work, which makes sense because I have a…
Patrick Szalapski
  • 8,738
  • 11
  • 67
  • 129
19
votes
1 answer

How to use a different base class in blazor page model partial declaration?

I am trying to use a pagemodel class in a client side Blazor in a way so i dont have to retype all the "base" properties I was thinking of creating class public partial class SomePage : BasePage { } Error CS0263 Partial declarations of…
mko
  • 6,638
  • 12
  • 67
  • 118
18
votes
8 answers

Unable to debug Blazor hosted webassembly 3.2.0 from Visual Studio 2019 16.6.2

I have Visual Studio 2019 16.6.2 installed, along with the .NET Core 3.1.301 SDK and all the necessary Blazor templates. If I create a brand new Blazor WebAssmbly application, I can run it from Visual Studio by pressing Ctrl+F5 and it opens a new…
1
2 3
47 48