Hi, @Ashley Davy
As far as I know, it's unable to access SerialPort via Blazor WebAssembly. And I already post answer with same thread here. Please check.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
When will Blazor support Web Serial Api for use on the client side with WebAssembly? I have a need to communicate with a Com Port from the end users browser. I thought that since I had enabled the permission through chrome://flags/#enable-experimental-web-platform-features that I could use System.IO.Ports and then call SerialPort.GetPortName() to get a list of available Com Ports. When I make the call GetPortName() I get an exception. How can I get this to work with C# code / WebAssembly?
Hi, @Ashley Davy
As far as I know, it's unable to access SerialPort via Blazor WebAssembly. And I already post answer with same thread here. Please check.
If you're developing your app for your customer you can:
In JavaScript: https://dev.to/unjavascripter/the-amazing-powers-of-the-web-web-serial-api-3ilc
Maybe it is possible to workaround using JavaScript functions in Blazor.
Or find an colleague who can do it in JavaScript directly.
Webassembly is a sandbox and has no access to the dom, network, files or browser apis. You need to send a message to JavaScript (blazor interop) to perform this.