How to debug embedded blazor-webassembly application

257 views Asked by At

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.

0

There are 0 answers