Converting Existing ASP.NET Core Web Application to a Local Desktop Application?

fatih uyanık 245 Reputation points
2025-12-05T06:43:54.2266667+00:00

Hello everyone,

I currently have a working ASP.NET Core (.NET 8) web application. My goal is to preserve the application's existing HTML/CSS/JavaScript interface and C# business logic (DI, Services, EF Core, etc.) while transforming it into an independent Windows desktop application, similar to WinForms/WPF.

The application must be distributable as an .exe and should not require an external web server.

I'm focusing on two main candidate technologies for this conversion but am struggling to understand the key differences between them.

Key Deciding Factors and Questions

  1. Blazor Hybrid (WPF/WinForms) Approach:

• This approach ensures my C# business logic runs as a fully native .NET process, with the UI displayed inside a WebView2 control.

• Question: Does this method guarantee that my C# code will run at full native performance and easily allow access to desktop capabilities like local file system access?

  1. Electron.NET Approach:

• This approach embeds my web application into a Chromium/Node.js shell (Electron) to port it to the desktop.

• Question: When using Electron.NET, does my C# code (API layer) still run on a Kestrel server in the background? Or does this solution also run as a completely native process? What are the performance disadvantages compared to Blazor Hybrid?

  1. Service Integration (DI):

• What is the best practice for porting my existing ASP.NET Core DI definitions (IServiceCollection registrations) to the new desktop project's startup point (Program.cs or App.xaml.cs) without rewriting them? (Adhering to the DRY principle.)

In summary: Which solution—Blazor Hybrid or Electron.NET—offers a more efficient and seamless experience for a Windows-only target with a .NET 8 project, while preserving the strength of my existing C# codebase (DI and performance)?

I would appreciate advice from experienced colleagues, especially regarding ease of distribution and local API access.

Thank you.

Developer technologies | .NET | Blazor
0 comments No comments
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.