Electron project in C#

Hi, I have to start a new project and I want to make it multi platform compatible. My idea is to use Electron using ElectronNET  that give support for C# . The code project will be .NET core, razor pages I think, so my question is: what is the best Syncfusion product for my project?

Best regards
Gian

3 Replies 1 reply marked as answer

AS Aaron Sellek Syncfusion Team December 11, 2020 10:03 AM UTC

Hello Gian,

Thank you for reaching out to us.

I apologize about the delay, i have been out of town. Our ASP.NET controls might be worth looking into but i will let you know the best option soon. I have passed on your inquiry to our developers and will update you as soon as possible.

Is this a work project?

Thanks!
Aaron


AK asim khan August 29, 2021 05:14 PM UTC

NET is not a goal of this project, at least we don't have any clue how to do it. We just combine ASP.NET Core & Electron.




JL Joshna Lingala Uthama Reddy Lingala Syncfusion Team September 6, 2021 01:22 PM UTC

Hi Asim, 
 
Greetings from Syncfusion. 
 
We have validated your query for “ Creation of Electron project with C# support” at our end. We let you know that this can be achieved with the following process 
 
Step 1: Create an ASP.NET Core application  
 
Using CLI : 
  1. mkdir {FolderName}
  2. cd {FolderName}
  3. dotnet new {ApplicatonName}
  4. Code . [To open with Visual Studio Code], otherwise open .csproj file with Visual Studio to open the application
                               (OR) 
For creation of sample with Visual Studio with syncfusion components, please refer the below UG 
 
 
Step 2: Electronize the project 
 
  • Install “ElectronNET.API” package
  • To start this Electron project add the UseElectron in WebHostBuilder-Extension in ~/Program.cs file
 
using ElectronNET.API; 
 
public class Program 
{         
    public static IHostBuilder CreateHostBuilder(string[] args) => 
         Host.CreateDefaultBuilder(args) 
             .ConfigureWebHostDefaults(webBuilder => 
              { 
                    webBuilder.UseElectron(args); 
                    webBuilder.UseEnvironment("Development"); 
                    webBuilder.UseStartup<Startup>(); 
               }); 
} 
 
 
 
  • To open Electron Window add the below code in ~/StartUp.cs
 
using ElectronNET.API; 
using ElectronNET.API.Entities; 
using System.Runtime.InteropServices; 
 
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 
{ 
    . . . 
 
    if (HybridSupport.IsElectronActive) 
    { 
         CreateWindow(); 
    } 
} 
 
private async void CreateWindow() 
{ 
    var window = await Electron.WindowManager.CreateWindowAsync(); 
    window.OnClosed += () => { 
        Electron.App.Quit(); 
    }; 
} 
 
 
 
Step 3: Open Command prompt and run the following commands 
 
  1. To run Electron Projects we need a “ElectronNET.CLI” packages, to install those run the below command
    dotnet tool install ElectronNET.CLI -g 
  1. To initiate the Electron.NET project run the following command
          electronize init 
  1. After successful initialization “electron.manifest.json” file will appear in the application
 
              
  1. To start the application run the following command
         electronize start  
 
We have prepared a sample for your reference, which you can download from the below link 
 
 
For more details about electron project, please refer the below blog 
 
 
 
Kindly try with the above sample and information and get back to us if you have any queries. 
 
Regards, 
Joshna L 
 


Marked as answer
Loader.
Up arrow icon