I am trying to debug my webassembly blazor client. I was previously using VS2019 fairly successfully, except that the breakpoints were unbound till I toggled them off and on again after starting the debug session.
I tried the VS 2022 preview and found that if I introduced a delay at the start of the app like this:
public class Program
{
public static async Task Main(string[] args)
{
#if DEBUG
Console.WriteLine("Delaying");
await Task.Delay(5000);
Console.WriteLine("Delay Done");
#endif
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.Services.AddBlazorise(options =>
... etc.
Then with .NET 5 libs and VS2022(preview) it worked. So I resolved to struggle on till the full releas came out, and now I have upgraded to the release version of 2022 and updated the libs to .NET 6. I am finding the problem is in fact worse. This because I can't get the breakpoints to bind at all any more.
Fortunately, I have not gotten very fara with this and can roll back to Net5 and VS2019 again. However, I was wondering if this is just me, or have I done something stupid.
I have checked that the DEBUG>OPTIONS>GENERAL>'Enable Javascript debugging for ASP.NET is enabled, however, here is agrab of my options in case anyone can see anything I have set wrongly...
Given that this has been going on for some time and I am far from the only person with this issue (though very little about it on here), I wondered if anyone could help as it is really stopping me from getting on atm.. Thanks in advance, Brett
EDIT I am interested in peoples thoughts on this. I took my backup of the project (at .net5) and upgraded it again. Now all seems to be working ok., but I can't help womdering if it isn't something to do with when I tried to restructure my components folder (which contains razor, razor.cs and razor.css files). It caused initial errors because the namespace for the razor files is implied and I needed to change that of the .cs files (I am using partial classes for them). After that, it was just broken. I also tried deleting the .vs file in the root project but that didn't help either. Is there a formal process for moving .razor files around? Curious.