Simple Steps to Convert an ASP.NET Core with Angular App to a Desktop App
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (182).NET Core  (26).NET MAUI  (233)Angular  (115)ASP.NET  (49)ASP.NET Core  (80)ASP.NET MVC  (85)Azure  (42)Black Friday Deal  (1)Blazor  (243)BoldSign  (15)DocIO  (24)Essential JS 2  (108)Essential Studio  (198)File Formats  (73)Flutter  (140)JavaScript  (227)Microsoft  (121)PDF  (86)Python  (1)React  (107)Streamlit  (1)Succinctly series  (131)Syncfusion  (988)TypeScript  (32)Uno Platform  (3)UWP  (3)Vue  (45)Webinar  (54)Windows Forms  (59)WinUI  (72)Word  (18)WPF  (165)Xamarin  (159)XlsIO  (38)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (11)Business intelligence  (55)Button  (4)C#  (164)Chart  (154)Chart of the week  (62)Cloud  (16)Company  (440)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (74)Development  (696)Doc  (7)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (7)Essential Tools  (13)Excel  (47)Extensions  (31)File Manager  (8)Gantt  (23)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (530)Mobile MVC  (9)OLAP server  (2)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (48)Performance  (13)PHP  (2)PivotGrid  (5)Predictive Analytics  (6)Report Server  (3)Reporting  (8)Reporting / Back Office  (9)Rich Text Editor  (12)Road Map  (12)Scheduler  (54)Security  (5)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (32)Solution Services  (4)Spreadsheet  (11)SQL  (15)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (426)Uncategorized  (68)Unix  (2)User interface  (67)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (19)Web  (650)What's new  (355)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
Simple Steps to Convert an ASP.NET Core with Angular App to a Desktop App

Simple Steps to Convert an ASP.NET Core with Angular App to a Desktop App

In this blog, we are going to walk through how to convert an ASP.NET Core with Angular (2 to 9+) web application to a desktop app. We are going to achieve this using Electron.NET dll build file.

Electron supports building cross-platform desktop applications with web technologies. It utilizes Node.js and the Chromium rendering engine to run a web application on a desktop shell.


Create an ASP.NET Core with Angular app

Please follow these steps to run an Angular application within the ASP.NET Core environment:

Step 1: First, create a new project by choosing the ASP.NET Core Web Application option. Then, click Next.

Create a New Project Dialog

Step 2: Now, select the Angular template for ASP.NET Core. Then, click Next.

Step 3: Then, provide a name to your project and click Next.

Step 4: Finally, select the Angular template, then check the Configure for HTTPS check box and click Create. Once the project is created, we can upgrade the Angular app to the latest version if needed.

Create a New ASP.NET Core Web Application Dialog

Note: We can also create an Angular application separately and then configure the ASP.NET Core to run the Angular app within the ASP.NET Core Web application.

Syncfusion Angular component suite is the only suite you will ever need to develop an Angular application faster.

Configure Electron with Electron.NET dll

Install the ElectronNET.API NuGet package

Step 1: First, right-click on the created project and choose the Manage NuGet Packages.

Choose the Manage NuGet Packages.. optionStep 2: Switch to the browse tab. Then, search for the Electron.NET NuGet package and install it.

Install the Electron.Net Nuget packageConfigure the Electron.NET in Program.cs file

Step 1: Now, add the following namespace in the Program.cs file.

using ElectronNET.API;

Step 2: Then, configure the Electron.NET package in the Program.cs file with the UseElectron WebHostBuilder.

public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>

Configure the Electron.NET in Startup.cs file

Step1: Let’s add the following namespaces in the Startup.cs file.

using ElectronNET.API;
using ElectronNET.API.Entities;

Step2: Next, place the ElectronBootstrap method in the Startup.cs file.

public async void ElectronBootstrap()
    BrowserWindowOptions options = new BrowserWindowOptions
        Show = false,
    BrowserWindow mainWindow = await Electron.WindowManager.CreateWindowAsync(options);
    mainWindow.OnReadyToShow += () =>
        mainWindow.SetTitle(“Application Name”);


Step 3: Now, configure the Electron.NET package by calling the ElectronBootstrap method in the Configure method in the Startup.cs file.

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)

Find the right property to fit your requirement by exploring the complete documentation for Syncfusion’s Angular components.

Install the ElectronNET.CLI NuGet package

The ElectronNET.CLI NuGet package is used to build and run the desktop application. You can install this package as a global package. That way, we can reuse it in the package manager console or command prompt.

Use the following command to install the ElectronNET.CLI package in your project:

dotnet tool install ElectronNET.CLI -g

Package Manager Console Dialog

Customize the debug and desktop menu

To debug the desktop app with the developer window, use the following code in the ElectronBootstrap method.



Also, you can add or update the existing desktop menu using the code in the ElectronBootstrap method.

Desktop menu

    MenuItem[] menu = new MenuItem[]
new MenuItem
      Label = “File”,
      Submenu=new MenuItem[]
         new MenuItem
             Label =”Exit”,
             Click =()=>{Electron.App.Exit();}
new MenuItem
      Label = “Info”,
      Click = async ()=>
         await Electron.Dialog.ShowMessageBoxAsync(“Welcome to App”);

Customize the desktop icon and splash screen

Also, you can update the splash screen image and desktop icon using the electron.manifest.json file in the root directory.

Refer to the following code example to update the desktop icon and splash screen.

    “executable”: “Sample”,
    “Splashscreen”: {
        “imageFile”: “2280.png”
    “name”: “Sample”,
    “author”: “”,
    “singleInstance”: false,
    “environment”: “Production”,
    “build”: {
        “appId”: “”,
        “productName”: “Sample”,
        “win”: {
            “icon”: “./bin/tbl.png”

See the possibilities for yourself with live demos of Syncfusion Angular components.

Initialize and build

Let’s see the procedures to initialize and build the desktop app.

Note: If your ASP.NET Core project is created without the Angular template, then take the Angular production build with this command before executing the electronize command:

ng build --prod

Step 1: Execute the following electron command in the command prompt or package manager console. This command should be executed only for the first time.

electronize init

Note: After executing the init command, the electron.manifest file will be generated in the root directory. Execute the electronize init command if there is any update in the application code that you want to include in the desktop app.

Step 2: Use the following command to watch the changes without stopping the application.

electronize start

Step 3: Finally, execute the following list of commands to generate the desktop application for the respective operating systems.

electronize build /target win
electronize build /target osx
electronize build /target linux
ASP.NET Core with Angular Converted to Desktop App Using Electron Framework
ASP.NET Core with Angular Converted to Desktop App Using Electron Framework

GitHub reference

Also, check out the complete code example to convert an ASP.NET Core with Angular app to a desktop app on GitHub.


In this blog, we have learned how to convert an ASP.NET Core with Angular app to a desktop application using the Electron framework. Try out the steps discussed in this blog and leave your comments in the feedback section given below!

The Syncfusion Angular UI component library is the only suite that you will ever need to build an Angular application, since it contains over 65 high-performance, lightweight, modular, and responsive UI components in a single package. Use them to build world-class applications!

For existing customers, the new version of Essential Studio is available for download from the License and Downloads page. If you are not yet a Syncfusion customer, you can try our 30-day free trial to check out our available features.

You can also contact us through our support forumsupport portal, or feedback portal. We are always happy to assist you!

Related blogs


Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed

Be the first to get updates

Subscribe RSS feed