dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.36k stars 9.99k forks source link

Could Blazor work on Electron to make cross-platform desktop apps? #16535

Closed chris-ray closed 4 years ago

chris-ray commented 6 years ago

I wonder if it would be possible to marry Blazor and Electron for an all (or nearly all) c# cross-platform desktop application development experience?

aammfe commented 5 years ago

@Arshia001 Electron.net is layer on layer which is painfull.

Arshia001 commented 5 years ago

It's layer alongside layer afaik.

199621616 commented 5 years ago

最好不加这个Electron,直接在.Net Core上托管Blazor或RazorComponents,在本机由Asp.Net Core替代Nodes.js,由WPF替代Electron的本机UI部分,然后调用云端WebApi,实现真正的C#全栈开发。如果能跨平台最好,即便不能跨平台,仅在Windows上实现,也足以解决我们目前面临的传统WinFrom或WPF应用现代化、互联网化的问题。

aammfe commented 5 years ago

@199621616 its been done by https://github.com/mattkol/Chromely

Daddoon commented 5 years ago

Here's a screenshot of a recent experiment we did to do a partial port of the Azure Storage Explorer (Electron app written in JS) to Blazor + Electron.NET and then ran it on a Mac:

image

This was just an experiment, but the startup perf looks great the UI perf is nice and fluid.

Hello @danroth27 , is your Azure Storage Explorer source code available somewhere ?

I'm actually re-working my Blazor.Xamarin plugin in order to make it works with Blazor 0.8.0, on UWP, iOS 12 and Android 4.4 and more .

There is work to do on the Android side, as Android WebView renderer is old , and even some recent Chrome for Android version does not support WebAssembly by default. I managed to create Xamarin Bindings for GeckoView usage on Xamarin as a WebView replacement, and Blazor works like a charm even on an old Android 4.4.

When all thoses works will be done, it would be nice, as a proof of concept, to see if i can embed and load Azure Storage Explorer on theses platform. Looking them from a tablet on iOS or Android as a standalone app would be nice !

danroth27 commented 5 years ago

Hi @Daddoon,

The code for the Azure Storage Explorer is not public. Maybe you could try the pizza store app from the Blazor workshop instead? https://aka.ms/blazorworkshop.

Also, please note that we're aren't monitoring this issue tracker closely anymore. If you have Blazor questions or issues please open them on the https://github.com/aspnet/aspnetcore repo.

xclud commented 5 years ago

Any chance to get the source code of @stevesandersonms demo at NDC-London?

danroth27 commented 5 years ago

@xclud Which one are you looking for? One of these?:

xclud commented 5 years ago

@danroth27 Thank you. I was looking for RazorComponentDemos but the two also are great to have.

default-writer commented 5 years ago

Am I only one who thinks that everything goes wrong? Why can't we just have html+css render in .NET and some .NET API for manipulating with DOM? Why we need so many other things (V8, JavaScript, WASM, etc)?

Actually, by adding .NET Core hosting capabilities to Electron, we instantly get all benefits of Blazor Server Side Rendering