0
votes

I've developed a machine control application that needs a technician panel - local and remote (internal local network). I thought a good way to avoid duplicate coding is use Blazor Web Assembly application, launch it locally in a WebView2 control or externally on the technician laptop and communicate with the system using gRPC.

All is well but one issue - I don't have and do not want to run a web server on the machine's computer.

Is there a way I can launch a web assembly application (Blazor) directly from a local file?

1
you will have to use something that properly serves the static blazor files, commonly you'd use a web server - Patrick Beynio
sorry i got sarcastic. no that's not possible, you'll need any webserver that's able to serve static files - Patrick Beynio
You don't need IIS. You could 'install' a Kestrel based app. - Henk Holterman

1 Answers

1
votes

One thing you could try is launching it as a desktop application using Electron or WebWindow. WebWindow is experimental, but a lot lighter than Electron. (See https://github.com/SteveSandersonMS/WebWindow)

Here is an article about using Electron and blazor WASM. https://medium.com/cloudnimble/bringing-your-blazor-apps-to-the-desktop-with-electronnet-blazor-67701bff82f7

You could also compile it to static html files and use a mini Python HTTP server to serve up the files. If you use Python 3 you can run the python -m http.server [port] command from the publish\wwwroot directory to serve up the files locally. You then just navigate to localhost:[port]to access your app.

Hopefully at least one of these approaches helps you.