Search code examples
maui-blazor

MAUI Windows open console windows on release


I am using MAUI blazor for developing an app. On debug build I can open chrome console window with shortcuts (CTRL+SHIFT+C), however on release I can't.

I have an issue that app crashes in release build and cannot find what the error is. How could I open chrome console window?


Solution

  • You can open the MauiProgram.cs file in your project, which has code like this:

    #if DEBUG
         builder.Services.AddBlazorWebViewDeveloperTools();
         builder. Logging. AddDebug();
    #endif
    

    This is to ensure that the Blazor Hybrid project is configured to support browser developer tools .You just need to remove the #if condition like this and it will be turned on in release mode too.

             builder.Services.AddBlazorWebViewDeveloperTools();
             builder. Logging. AddDebug();