英文:
MAUI Windows open console windows on release
问题
我正在使用MAUI Blazor开发应用程序。在调试版本中,我可以使用快捷键(CTRL+SHIFT+C)打开Chrome控制台窗口,但是在发布版本中无法。我遇到了一个问题,应用在发布版本中崩溃,但是无法找到错误在哪。我该如何打开Chrome控制台窗口?
英文:
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?
答案1
得分: 1
你可以在你的项目中打开MauiProgram.cs文件,其中的代码如下:
builder.Services.AddBlazorWebViewDeveloperTools();
builder.Logging.AddDebug();
这是为了确保Blazor混合项目配置为支持浏览器开发者工具。你只需要将#if条件移除,像这样,它就会在发布模式下启用:
builder.Services.AddBlazorWebViewDeveloperTools();
builder.Logging.AddDebug();
英文:
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();
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论