Electron.NET

I would like to introduce a Electron.NET That library wraps electron and asp.net core application.

To test Electron.NET we need to install it. So, type:

dotnet tool install ElectronNET.CLI -g

After that we can create solution file

dotnet new sln -n ElectronHelloWorld

now we can add asp.net web application

dotnet new razor -lang C# -n ElectronApplication -o ElectronApplication

we need to add Electron.NET to our project, so type this

dotnet add package ElectronNET.API

add UseElectron in Program.cs

public static IHostBuilder CreateHostBuilder(string[] args) =>
    Host.CreateDefaultBuilder(args)
        .ConfigureWebHostDefaults(webBuilder =>
        {
            webBuilder.UseElectron(args);
            webBuilder.UseStartup<Startup>();
        });

and add this line

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

to the end of Configure method in Startup.cs

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    if (env.IsDevelopment())
    {
        app.UseDeveloperExceptionPage();
    }
    else
    {
        app.UseExceptionHandler("/Error");
        app.UseHsts();
    }

    app.UseHttpsRedirection();
    app.UseStaticFiles();
    app.UseRouting();
    app.UseAuthorization();

    app.UseEndpoints(endpoints =>
    {
        endpoints.MapRazorPages();
    });

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

type this in ElectronApplication folder

electronize init
electronize start

and voilà 🙂

I’ve found this library today and I haven’t made any big project with Electron.NET. But the first impression is very nice. I’m going make a bigger project with this tool.

Read it #18

What is NULL?
If you are good sql programmer, you probably know everything about null. But if you start your adventure with sql you should read it.
postgresql

Flexbox and absolute positioning
Comparision of absolute and flex positioning.
css

New CSS for Styling Underlines on the Web
Do you know text-underline-offset, text-decoration-thickness and text-decoration-skip-ink? No? Watch it.
css
Continue reading “Read it #18”

Read it #14

Pooling large arrays with ArrayPool
Great article about ArrayPool. It’s a high performance pool of managed arrays.
C# memory performance

Which tables should be auto vacuumed or auto analyzed?
I think that title tells us everything.
postgresql

OAuth authentication with Facebook and ASP.NET Core 3.0
In this article authore covered how to use OAuth to allow users to login from facebook providers.
asp.net core
Continue reading “Read it #14”