gpt4 book ai didi

visual-studio-2019 - 无法从 Visual Studio 2019 16.6.2 调试 Blazor 托管的 webassembly 3.2.0

转载 作者:行者123 更新时间:2023-12-03 15:02:23 25 4
gpt4 key购买 nike

我安装了 Visual Studio 2019 16.6.2,以及 .NET Core 3.1.301 SDK 和所有必要的 Blazor 模板。
如果我创建了一个全新的 Blazor WebAssmbly 应用程序,我可以通过按 Ctrl+F5 从 Visual Studio 运行它,它会在我的事件浏览器窗口中打开一个新选项卡并正常启动。
但是当我按 F5 时,会打开一个新的单独的浏览器窗口(这有点烦人),但页面仍然位于 about:blank一段时间,直到 Visual Studio 中出现错误消息:

Failed to launch debug adapter.  Additional information may be available in the output window.

Unable to launch browser:
"Could not open wss://localhost:5001/_framework/debug/ws-proxy?browser=wsAFFlocalhostA50821FdevtoolsFbrowserFceed3b95-58ac-470a-b10c-5d139cfd7117": timeout after 60000ms
Blazor WebAssembly 应用程序是否“托管”并没有什么区别。
我已按照 Enforce HTTPS in ASP.NET Core 中的步骤进行操作,但这并没有什么区别。
如果,同时等待 about:blank窗口崩溃,我在浏览器选项卡上手动打开客户端 url,加载应用程序并命中调试器断点。
在它继续崩溃之前的短时间内,如果我按 Shift+Alt+D,我总是会收到以下错误:
Unable to find debuggable browser tab
Could not get a list of browser tabs from http://127.0.0.1:9222/json. Ensure your browser is running with debugging enabled.

Resolution

If you are using Microsoft Edge (80+) for your development, follow these instructions:
Press Win+R and enter the following:

msedge --remote-debugging-port=9222 --user-data-dir="C:\Users\sergi\AppData\Local\Temp\blazor-edge-debug" --no-first-run https://localhost:44372/
无论我运行命令的频率如何(关闭所有浏览器实例,重新启动等),我每次都会得到这个。
这发生在 Edge 84 (Edgium) 和 Chrome 中。
我应该能够创建一个新的 Blazor WebAssembly 应用程序并在 Visual Studio 上开箱即用地按下 F5。我错过了什么?
更新
我刚刚尝试使用“旧 Edge”(EdgeHtml)和 Firefox 作为 Visual Studio 中的调试浏览器,并且两者都按预期工作(意味着应用程序至少在按 F5 时启动)。问题似乎是基于 Chromium 的浏览器,然后......
更新 2
@JamesHancock 在评论中发布了一个足够简单的解决方法。如需完整的解决方案(和解释), I've logged a Github issue与 ASP.NET Core 团队合作。

最佳答案

对我来说,我失踪了 app.UseWebAssemblyDebugging();Startup.Configure() .希望这可以帮助某人。

关于visual-studio-2019 - 无法从 Visual Studio 2019 16.6.2 调试 Blazor 托管的 webassembly 3.2.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62349412/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com