D. Olson
D. Olson

Reputation: 11

WebSocket disconnects when debugging Uno-platform WebAssembly project

I'm new to Uno-Platform (and, in general, debugging in Chrome). I'm having trouble getting Chrome to debug my Uno-Platform WASM project. I followed the instructions here,(https://github.com/unoplatform/uno/blob/master/doc/articles/debugging-wasm.md/) but I keep getting this popup: Chrome WebSocket disconnected message

When I click on the "Reconnect DevTools" button, the popup displays again. I suspect it's something simple that I'm doing wrong.

Anyone have ideas?

Upvotes: 1

Views: 366

Answers (2)

Gareld
Gareld

Reputation: 3

For me the issue was fixed by using the version 1.3.4 of the Uno.Wasm.Bootstrap and Uno.Wasm.Bootstrap.DevServer NuGet-packages, instead of the newer versions.

Upvotes: 0

Jérôme Laban
Jérôme Laban

Reputation: 5282

The debugging story for .NET on WebAssembly is evolving very quickly lately, and the Visual Studio and .NET team have included preview support for it in 2019 16.6 Preview 1 and up.

The documentation is not yet up to date in the Uno repo, but to use it with Uno, you'll have to do this in your Wasm project file:

  • If you had a <DotNetCliToolReference /> line remove it
  • Add a nuget reference to Uno.Wasm.Bootstrap.DevServer prerelease package
  • Update Uno.Wasm.Bootstrap to the same prerelease version as DevServer

Then update the launchSettings.json file, add the following line just after each "launchBrowser": true, line :

"inspectUri":
  "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",

You should be able to debug with a more stable experience inside of Visual Studio, but note that the debugging support is still in preview and you may still encounter issues.

Upvotes: 2

Related Questions