C
C#8mo ago
PatrickG

.net 8 blazor wasm front end breakpoints only work SOME of the time

sometimes i launch the project and they hit, and sometimes they dont. I have no idea why. does anyone know>?
7 Replies
D.Mentia
D.Mentia8mo ago
Make sure your DI registration is right, look up some examples. You may be missing stuff like services.UseRazorComponents, or UseRouting could be in the wrong place (sometimes order matters), etc And make sure you're not accidentally registering multiple things that setup routing, or if you need that, make sure they're compatible and not overriding each other, etc I had a blazor server app doing the same thing recently and was missing UseBlazorSignalR (or something like that) Also be careful about following tutorials not made specifically for the flavor of aspnet you're using (blazor clientside?) because they might have made you register some wrong things, I still have no idea which registrations are actually important and which ones do nothing or break something, in my blazor web app
Diceble
Diceble8mo ago
If I remember it correctly everything before the builder.build() doesn't matter in order. Once your app is build and you using methods Use... the order does matter
D.Mentia
D.Mentia8mo ago
that makes sense, I think the ones I'm thinking of were indeed in the Use section after building well... it depends I suppose, cuz order does matter before you build, the latest registration for a given type overrides previous ones. So if you have two builder registrations that setup routing, the last one may override the first, depending on exactly what they register
Diceble
Diceble8mo ago
I'm not sure how the builder picks it up. if it's first registered first exectued or that there is some mechanism that the builder decides itself in what order it wants to execute it.\
D.Mentia
D.Mentia8mo ago
I'm p sure the last registration overrides previous ones, I've used that concept before in unit tests to have a specific test mock something that is registered already in the base test (to be used by other tests)
Diceble
Diceble8mo ago
I see
PatrickG
PatrickGOP8mo ago
i dont know your solution seems like it would solve an issue where it never works. mine SOMETIMES work and sometimes don't like, same project, i launch it it works. then i stop it i wait 2 minute i launch it again and it doesn't work anymore
Want results from more Discord servers?
Add your server