Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Breakpoints won't hit in Blazor Webassembly project, ASP.NET Core 3.1,

Breakpoints won't hit in ASP.NET Core 3.1, Blazor Webassembly project.

I have a solution with a single Blazor Webassembly project which I run locally.

When placing a breakpoint in a .cs file it says:

"The breakpoint will not currently be hit. A copy of Startup.cs was found in blazor-devserver.dll, but the current source code is different from the version built into blazor-devserver.dll.

To allow this breakpoint to be hit, click the 'Settings...' button that appears, then click 'Location', 'Allow the source code to be different from the original.' ..."

This seems strange to me because I don't deploy, I just hit F5 in Visual Studio so I don't see how the code can be different.

Wen the breakpoint is placed in a .razor file it says:

"The breakpoint will not currently be hit. No symbols have been loaded for this document"

In the modules window, symbols have been loaded for all entries.

It worked fine until recently. Only thing I did was installing Microsoft Code Anlysis 2019 (removed it again).

like image 965
Dabriel Avatar asked Nov 14 '19 10:11

Dabriel


People also ask

Does Blazor work with .NET core?

Blazor Server provides support for hosting Razor components on the server in an ASP.NET Core app. UI updates are handled over a SignalR connection. The runtime stays on the server and handles: Executing the app's C# code.

Does hot reload work with Blazor?

Blazor WebAssemblyHot Reload reacts to most changes to method bodies, such as adding, removing, and editing variables, expressions, and statements. Changes to the bodies of lambda expressions and local functions are also supported.


1 Answers

Blazor Webassembly is still in preview stage hence you cannot debug the cs file directly. Debugging is supported via Chrome only. The details are documented here.

like image 109
ViRuSTriNiTy Avatar answered Dec 05 '22 18:12

ViRuSTriNiTy