How to debug embedded blazor-webassembly application

北慕城南 提交于 2021-01-29 18:03:56

问题


We host Blazor app as embedded section of a page. Web site itself is a react app. It is convenient for us to use Blazor as dynamic UI engine to draw elements like in a diagram tool.

It works well but I would like to know if anyone had a chance to either a. attach a debugger to a running browser and able to set breakpoints and hit them in Visual Studio b. or be able to configure "launch" setting so it would see such app and web assembly as a regular Blazor app and connect to it.

on the web page final html page has this section:

<script src="composer/_framework/blazor.webassembly.js" autostart="false" async></script>

loaded webassembly takes care of loading a frame with blazor app inside of a web page.

Ideally I would see a launchSettings.json a laucch configuration that would allow as per original setup to have a debug configuration similar to this one:

 "ComposerDebug1": {
      "commandName": "Project",
      "launchBrowser": false,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "http://localhost:5000",
      "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}"
    }

but in reality, nothing needs to be launched and correct values for wsProtocol and others needs to be provided.

Any suggstions are welcome.

来源:https://stackoverflow.com/questions/64107680/how-to-debug-embedded-blazor-webassembly-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!