mykeels.com

ASP.NET Core is Electronized

I stumbled upon the Electron.NET package on GitHub, on Friday November 10th, 2017, and told myself I’d definitely do stuff with it this…

ASP.NET Core is Electronized

I stumbled upon the Electron.NET package on GitHub, on Friday November 10th, 2017, and told myself I’d definitely do stuff with it this weekend because I was awed!

Gives me shivers every time!

Admittedly, I didn’t fully understand how it worked, but it’s the love-child of two beautiful pieces of technology I know, use and love, .NET and JavaScript, so hey! I was definitely trying it out.

The weekend passed and I didn’t get a chance to play with it because of a combination of fatigue, and a lack of consistent … electricity.

So now it’s Monday, and there’s some free time. Whoop! Whoop!!!

Getting Started

The official README is a wonderful place to get started. It’s easy to understand and the tech is easy to setup and use.

I now have a sample application up and running on my desktop, which is totally cool!!!

Yaaaaaaaay!!!

How it works

From reading the README, and looking at code, I can see that it’s actually two apps merged in one. Your asp.net core app runs in the background, obviously … and it starts the Electron app in a window with:

Task.Run(async () => await Electron.WindowManager.CreateWindowAsync());

So, the Electron app is actually what you’d see if you were serving the app to a browser.

In fact, if you went to your browser, http://localhost:8002 (in my case), you’d see your app.

Yep! There it is!

So, what next?

Now, I’ve been thinking …

What are the advantages of having your app split into front-end and back-end within the same app that you couldn’t achieve with a classic Electron App?

Porting code is way easier

If your dev team is familiar with asp.net core or you even have backend logic built with .NET, it should be relatively easy to port your app to desktop via Electron.NET.

Run your server apps in window-mode

One more thing I can think of is starting your asp.net core app in window-mode, so you can have a cool GUI for monitoring server internals in real-time. But that’s only useful when you’re in control of your server, so 😩.

Peer-to-peer connection

Another idea is facilitating peer-to-peer connection mode would be much easier now, and this would help add network-play to games built with HTML5.

So, what else can you think of?

Could this be a game changer?

Give your feedback in the comments below, and don’t forget to clap for this article if you liked it.

Related Articles

Tags