
Build .NET Desktop Applications Using HTML, CSS and JavaScript - m_fayer
https://github.com/NeutroniumCore/Neutronium
======
yodon
As an alternate approach for .NET desktop apps, Electron.NET[0] is a variant
of Electron that adds a dotnet backend. Build your UI in the HTML/CSS/JS
flavor of your choice and then implement the functionality backing that UI in
C#.

Electron.NET is relatively new and I just yesterday published what I think is
the first boilerplate sample for it (using React/Typescript/MobX) [1] (note:
my sample app currently looks terrible because there’s exactly zero CSS
applied, I was hoping to get some of that added later this week having gotten
the functional details working first. The demo in the Electron.NET repo
replicates the stock Electron demo, if you’d like to start your explorations
with pretty first).

[0]
[https://github.com/ElectronNET/Electron.NET](https://github.com/ElectronNET/Electron.NET)

[1] [https://github.com/yoDon/Electron.NET-React-Typescript-
MobX](https://github.com/yoDon/Electron.NET-React-Typescript-MobX)

~~~
paxy
Both projects eventually use the Chromium renderer, just with .NET bindings,
so all you're doing is introducing a whole new framework dependency in order
to make development a bit easier.

While I love the concept (and C#/.NET in general), this is yet another
performance hit for end users.

~~~
yodon
You don’t have to use Electron if you don’t want to, and end users don’t have
to use apps if they don’t like the performance characteristics of the apps.
That said, there are a lot of very well liked apps being built very quickly on
the the Electron framework, and those of us who like C# can do so even more
happily using Electron.NET. So to tl;dr this answer to your comment, yes, it’s
100% about introducing the desired framework dependency to make development
easier.

~~~
andrew_
What I don't understand is: If Electron apps can be compiled to be cross-
platform out of the box, why use an Electron binding for .NET that makes it
inherently locked into Windows (without jumping through fancy hoops for other
platforms)? I wrote _a lot_ of Windows-only freeware on .NET over the years,
and there's just no reason for it that I can see, if the core component of an
app is cross-platform by default.

~~~
yodon
> Why use an Electron binding for .NET that makes it inherently locked to
> Windows

You’re a couple years behind on cross platform support in dot net and
completely missing the cross platform support in Electron/Electron.NET. Zero
hoops to jump. Electron.NET apps just work, out of the the box, on macOS and
Linux, in addition to on Windows. Today.

~~~
mikewhy
I don't think this is cross-platform:

Cross Platform? (Closed):
[https://github.com/NeutroniumCore/Neutronium/issues/14](https://github.com/NeutroniumCore/Neutronium/issues/14)

And it looks like all the examples reference .net 4.5, which isn't .net core:
[https://github.com/NeutroniumCore/Neutronium/search?p=1&q=NE...](https://github.com/NeutroniumCore/Neutronium/search?p=1&q=NETFramework&type=&utf8=%E2%9C%93)

~~~
nightski
That's not Electron.NET which is what the parent was referring to.

------
nulagrithom
Serious question as a .NET developer...

Why? What's the advantage?

My first thought would be to skip the .NET and just use JavaScript all the way
down. Or skip JavaScript and just go .NET all the way down.

Second thought would be to just go typical client-server, which is what I
think I'm basically seeing here?

The advantages aren't clear to me.

~~~
yodon
Microsoft has so mismanaged WPF over the years that most developers want
nothing to do with it. That means the dot net world lacks any sort of real UI
building capability, forcing us int HTML/CSS/JS front ends (at least until
Mono goes live with their WebAssembly port of dot net, at which point we can
write our front ends in C# again, hopefully not far into 2018)

~~~
DarrenZ
>the dot net world lacks any sort of real UI building capability

Off the shelf, yes. But third party providers like Devexpress and Telerik have
stepped into that gap and now produce some very polished component suites that
sit on top of Winforms. At a cost, of course, and more geared towards the
enterprise market.

I've used component suites like these in new .Net desktop products and without
fail they're received well.

~~~
tonyedgecombe
My main product is largely WinForms and the UI was quick and easy to develop.

The two downsides that stop me using it now are poor high dpi support and lack
of decent cross platform support.

~~~
pjmlp
High DPI support is available on .NET Framework 4.7.

[https://docs.microsoft.com/en-
us/dotnet/framework/winforms/h...](https://docs.microsoft.com/en-
us/dotnet/framework/winforms/high-dpi-support-in-windows-forms)

EDIT: Typo

~~~
ComputerGuru
That’s 4.7, not 7.

~~~
pjmlp
Thanks.

------
ComputerGuru
Avalonia [0] is a cross-platform XAML-like UI library for .NET that supports
Windows, Linux, and Mac via their native UI toolkits.

0: [http://avaloniaui.net](http://avaloniaui.net)

------
megamindbrian2
Isn't this what Electron is for? Why do this?

------
iamcreasy
Is there anything similar for Java and electron?

------
nwah1
DotVVM has Electron support. Have you looked at it?

------
andrew_
or just like, use Electron and cut out the dependency on .NET

~~~
romanovcode
Better yet, use .NET and cut out dependency on Electron.

~~~
andrew_
if the whole point of the lib is to run html/js/css in a desktop-friendly app,
you don't need .NET for any of it. yes, I've worked with both and worked with
the browser interfaces for .net as far back as 1.0. It's simply not needed.

