13 ms·
Electron.Net: Build cross platform desktop apps using .NET core and ASP.NET core
- deleted 9y ago[deleted]
- deleted 9y ago[deleted]
- moomin 9y agoThis is amazing and frustrating at the same time. The biggest problems, both of which are I think unavoidable, are the necessity to be aware of serialization and the version lock.
- seanzer 9y agokeeping up with electron api changes is going to be a nightmare
- msoad 9y agoCan someone explain what is this? Why someone might need this??
- slowmotiony 9y agoI don't think there is currently any easy way to build a GUI app using .NET Core. This might come in handy for such projects.
- pknopf 9y agoI am currently working on .NET/QML integration here: https://github.com/pauldotknopf/net-core-qml https://github.com/pauldotknopf/net-core-qml Not quite production yet, but it will be soon.
- roryisok 9y agoI can't find any GUI info here, I'm assuming that you still need to use html/CSS on top of webkit on top of node.js which then runs .net core in another process
- seanzer 9y agoIt just enables you to serve pages from an ASP.NET server running locally. In the client code, you get access to nodejs apis, in the server code, you can call electron apis using the api bridge
- sz4kerto 9y agoMany people like C#/F# more than Javascript (and it's derivatives).
- cm2187 9y agoAnd for many, “like more” is an understatement.
- pknopf 9y agoThis reminds me of the project I am currently working on. .NET/QML https://github.com/pauldotknopf/net-core-qml https://github.com/pauldotknopf/net-core-qml Not quite production yet, but it will be soon. I'd love to here some input. You can check the unit tests for how things are working currently. At a certain point, I will also implement a Qml debugger in visual studio code.
- jcelerier 9y agothat's great! you should consider sharing this on the Qt mailing list.
- dodyg 9y agoAwesome. Starred!
- _pmf_ 9y agoVery nice. I have used both WPF/XAML and QML and definitely find QML's model much more intuitive (anchors make things so much easier). Looking forward to trying it out!
- LemurMadness 9y agoI really like this approach, particularly since it allows a clean separation between the responsibilities of designing the UI and writing the back-end code. The UI designer can still wire up events and design them in Qt Creator (maybe using placeholder events?) but then the .NET dev can write the back-end stuff for it.
- pknopf 9y agoExactly. The tech-stack perfectly slices responsibilities. That is what really motivated me to do it. Seemed like peanut butter and jelly. Also, performance. Anything beats electron.
- pjmlp 9y agoPlease use Xamarin.Forms or Avalonia instead.
- Steveorevo 9y agoWhy not use GitHub's native Electron? Just remember what Microsoft did to Java with JNI. Assimilate. Resistance is futile.
- roryisok 9y agoWell the point of this project is to allow someone to use .net in the background, although this is already possible with the edge.js project (nothing to do with the edge browser)
- breakingcups 9y agoThis project doesn't appear to have anything to do with Microsoft other than the fact that it uses .NET. Your comment is not only uncalled for, it's also very off-topic.
- roryisok 9y agoI was really excited when I saw this because I thought someone had finally brought us a .net alternative to electron, using xaml. Unfortunately this seems to be electron but with a .net webapp running in the background? You still need node and webkit for the UI it seems. If that's what this is, it was already possible to do with edge.js and electron so I'm not sure what advantage there is here.
- cm2187 9y agoAgree. To me the solution will be webassembly. I entertain the hope that there will be a .net runtime for webassembly, in which case you will be able to write a full cross platform application without having to write a line of JavaScript. Won’t be XAML+.net but will be HTML+.net.
- hacker_9 9y agoDOM interaction and Garbage Collectors are still a heavy research topic within the WebAssembly community, and aren't part of the MVP [1]. Plus MS would need to create a custom C# -> WASM compiler as they don't use LLVM internally. All this means you are probably going to be waiting at least another 5 years before you can compile .Net GUI apps straight to the web. [1] http://webassembly.org/docs/future-features/ http://webassembly.org/docs/future-features/
- j_s 9y ago> C# -> WASM compiler https://github.com/kg/ilwasm/ https://github.com/kg/ilwasm/ [2015] Unfortunately, more proof of concept than anything
- hacker_9 9y agoNo doubt you'll find lots of attempts on github, but no business will touch it unless it's an offical compiler with Microsoft's backing, who continue to release updates and provide support for it.
- 9y ago
- seanzer 9y agoIs this a framework built on top of electron? Is there an ASP.NET server running in addition to the electron processes? It's just serving pages to the electron renderer processes, and there's an api bridge over socket IO to invoke electron methods from .NET-land? ...mindblown...
- seanzer 9y agocool, but unfortunately not what I was expecting
- lwansbrough 9y agoI think this highlights the need for Microsoft to open source Edge’s new rendering engine. I’d love to be able to use the renderer in .NET Core for a whole host of applications (including rendering dynamic HTML to OpenGL) but unfortunately EdgeHTML has remained closed source! With many components of the .NET stack being open sourced, and even some of the Edge stack, I had high hopes for seeing the rendering engine open sourced as well too - but no such luck. Can anyone on the Edge team comment on this? There would be so many major use cases for this in .NET. Currently we have to use CEF but I really don’t like being forced to delegate work to Chrome - it further secures Chrome’s place as “the only browser”. Not to mention the Edge team would likely receive many benefits from open sourcing the project in the way of pull requests, even if this is a little more managerial overhead. This has been requested on MS’ UserVoice site. Would love to see it get some love. https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer/suggestions/18543541-make-edgehtml-layout-engine-open-source https://wpdev.uservoice.com/forums/257854-microsoft-edge-dev... Also, what I'd love to see would be some sort of UI subsystem that all vendors target. Something built on a protocol that can be implemented in any language, and communicated to by any other language. That way all browsers' HTML renderers would target the same UI subsystem, and any UI framework could choose to either target HTML or the UI subsystem itself, as well. That UI framework (if it targets the UI subsystem) could then be run in a different context (say a JS engine running in .NET) and its output could be routed to a .NET implementation of the UI subsystem. This would allow any components built in any language to interface and work together using a common protocol, and as long as you can host the language a given UI framework is built in, you can use it to create UI elements in whatever platform you want. I see this as being THE solution to JS/web/UI stuff - there's tons of amazing developments happening there, but we can't use them in the desktop world. I'd like to see that change, and in a way that doesn't require running an entire browser inside a desktop app.
- hacker_9 9y ago> This would allow any components built in any language to interface and work together using a common protocol No it wouldn't? How would a C++ app run my managed control built in C#? Or my JS page run components written in Rust, Java and Clojure? Unless you are expecting all of the runtimes to be bundled with the app/page too, in which case good luck with your file size and startup time...
- alkonaut 9y agoCan't we just make a proper, easy to use portable desktop application framework please? I really don't care what language is used so log as JS is avoidable (It can still be a compilation target so it could even be JS), and I can make a snappy desktop app that takes 10 not 100mb. I'm not even sure which one I'm hoping for at the moment. Xamarin seems to have bet fully on mobile. Avalonia looks nice but feels like it would need some enterprise backing.
- headmelted 9y agoStandard WinForms and/or Java isn't too far off what you're describing if you're willing to install runtimes, but I know that's not what you're looking for and I see your point. The difficulty is that people used to agree (and at varying times, sue each other) over which metaphors to use. The desktop platforms are growing further apart on this front. Linux has so much work-in-progress happening at any one time that sustainable fusion is closer than a finished and implemented Wayland. Windows is still pushing a "modern" UI metaphor that no-one can stand. Apple has to my knowledge never shown any interest in what you're proposing at all. That leaves the option of creating another UI layer on top for the app to sit in, and Electron/HTML5 isn't a terrible fit for that. Maybe trying to get rolling with LLVM and emscripten to run the Electron logic is your answer, or Typescript if it helps ameliorate some of the JS qualms for you.
- egeozcan 9y agoYeah, if Electron had just one advantage, it would be that it's available and works today.
- fsloth 9y ago"The difficulty is that people used to agree (and at varying times, sue each other) over which metaphors to use" I think you hit the nail on the head. A UI common library should not provide metaphors but direct access to the renderdable elements, their layout routines, etc. A proper UI library would resemble a modern 3D game engine more by its interface. The level where UI metaphors step in would be built on top of this basic substrate. There are oh-so-many projects out there trying to use this pattern but for some reason they've not reached popularity.
- hacker_9 9y agoThis is a pretty neat idea, but I see no tests for the code or any sample usage. Looks like there's still a lot of work to do.
- gungoman 9y agoI'd be happier to see GTK+, Qt or another toolkit ported to .NET Core instead.
- kristiandupont 9y agoOk, I normally find myself disagreeing with HN every time Electron comes up. Basically, I think the upsides are worth the size and performance tradeoffs. However, this seems to be almost an entire server deploy as well as a complete renderer all in one package. That does seem excessive to me for a desktop app.
- ygra 9y agoAren't there Electron applications that effectively bundle node.js as well? Isn't that kind of the same?
- dspillett 9y agoAll Electron apps do - that is what the Electron framework is: a bundle of Chromium for the front-end and Node for the back-end (where here front/back are UI/internals rather than client/server as they are in an online web application). See https://en.wikipedia.org/wiki/Electron_(software_framework) https://en.wikipedia.org/wiki/Electron_(software_framework) along with the official docs (though the official docs don't state this construction quite as plainly, it doesn't hide the fact).
- romanovcode 9y agoNode.js does the same on "standard" electron apps. What's your point here? This could actually be faster since C# is faster language than Node.
- shakna 9y ago> However, this seems to be almost an entire server deploy as well as a complete renderer all in one package. That does seem excessive to me for a desktop app. That's precisely what Electron is. So what's the difference if you're okay with one?
- kristiandupont 9y agoDoes this not include node as well as .net core?
- asp_net 9y agoI really like that. Re-using the existing Electron platform and not reinventing the wheel and making it usable with .NET underlying is really a good thing. People, XAML is dead. Get over it ;-).
- thedonkeycometh 9y agoWhy is XAML dead?
- FlorianRappl 9y agoI don't get this thing. Why do you need to run a webserver an render webpages when we have more powerful alternatives for cross-platform apps? Also if you need interactivity you need JS anyway, so you can switch your server side rendering to client side rendering, thus eliminating the need for this wrapper anyway. Maybe I am missing something (and if someone tells me I am missing .NET libs then my response is Edge.js, https://github.com/tjanczuk/edge https://github.com/tjanczuk/edge).
- lucaspottersky 9y agoso, could somebody make a quick summary of what's currently available for building desktop apps (self-contained that doesn't require the user to install a runtime)?
- AlexeyBrin 9y agoFreePascal executables. AFAIK, a compiled FreePascal GUI app does not need the user to install a runtime. I assume Win32 apps also runs on different versions of Windows without installing a runtime.
- deleted 9y ago[deleted]
- amelius 9y agoI'm still looking for something like this that works with Python. Python is huge in numerical libraries (numpy/scipy) and deep learning. But it is lacking in UIs. Yes, there's PyQt, but Qt is GPL'ed, making it impossible to use at our shop. And wxPython feels really archaic to use.
- edwinyzh 9y agoWhat you need is http://www.lazarus-ide.org/ http://www.lazarus-ide.org/ for cross, native app development. Here is a list of programs built with Lazarus/FPC: http://wiki.freepascal.org/Lazarus_Application_Gallery http://wiki.freepascal.org/Lazarus_Application_Gallery
- velobro 9y agoWhy comment at all if you're simply going to ignore the article and advertise something else?