Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

:electron: Build cross platform desktop apps with ASP.NET Core (Razor Pages, MVC, Blazor).

License

NotificationsYou must be signed in to change notification settings

ElectronNET/Electron.NET

Repository files navigation

Electron.NET Logo

donateGitterBuild status

Electron.Net Core is here!

A Complete Transformation

ElectronNET.Core represents a fundamental modernization of Electron.NET, addressing years of accumulated pain points while preserving full API compatibility. This isn't just an update—it's a complete rethinking of how .NET developers build and debug cross-platform desktop applications with Electron.

Read more:What's New in ElectronNET.Core

Build cross platform desktop applications with .NET 6/8 - from console apps to ASP.Net Core (Razor Pages, MVC) to Blazor

Wait - how does that work exactly?

Well... there are lots of different approaches how to get a X-plat desktop app running. Electron.NET provides a range of ways to build .NET based solutions using Electron at the side of presentation. While the classic Electron.Net setup, using an ASP.Net host ran by the Electron side is still the primary way, there's more flexibility now: both, dotnet and Electron are now able to launch the other for better lifetime management, and when you don't need a local web server - like when running content from files or remote servers, you can drop the ASP.Net stack altogether and got with a lightweight console app instead.

📦 NuGet

NuGet ElectronNET.Core |NuGet ElectronNET.Core.API |NuGet ElectronNET.Core.AspNet

🛠 Requirements to Run

Our API uses .NET 6/8, so our

Also you should have installed:

👩‍🏫 Usage with ASP.Net

  • Create a new ASP.Net Core project
  • Install the following two nuget packages:
dotnet add package ElectronNET.Coredotnet add package ElectronNET.Core.AspNet

Enable Electron.NET on Startup

To do so, use theUseElectron extension method on aWebApplicationBuilder, anIWebHostBuilder or any descendants.

Note

New in Electron.NET Core is that you provide a callback method as an argument toUseElectron(), which ensures that you get to know the right moment to set up your application UI.

Program.cs

usingElectronNET.API;usingElectronNET.API.Entities;publicstaticvoidMain(string[]args){WebHost.CreateDefaultBuilder(args).UseElectron(args,ElectronAppReady).UseStartup<Startup>().Build().Run();}publicstaticasyncTaskElectronAppReady(){varbrowserWindow=awaitElectron.WindowManager.CreateWindowAsync(newBrowserWindowOptions{Show=false});browserWindow.OnReadyToShow+=()=>browserWindow.Show();}

🚀 Starting and Debugging the Application

Just press F5 in Visual Studio or use dotnet for debugging.

📔 Usage of the Electron API

A complete documentation is available on the Wiki.

In this YouTube video, we show you how you can create a new project, use the Electron.NET API, debug a application and build an executable desktop app for Windows:Electron.NET - Getting Started

Note

The video hasn't been updated for the changes in ElectronNET.Core, so it is partially outdated.

👨‍💻 Authors

  • Gregor Biswanger - (Microsoft MVP, Intel Black Belt and Intel Software Innovator) is a freelance lecturer, consultant, trainer, author and speaker. He is a consultant for large and medium-sized companies, organizations and agencies for software architecture, web- and cross-platform development. You can find Gregor often on the road attending or speaking at international conferences. -Cross-Platform-Blog - Twitter@BFreakout
  • Dr. Florian Rappl - Software Developer - from Munich, Germany. Microsoft MVP & Web Geek. -The Art of Micro Frontends -Homepage - Twitter@florianrappl
  • softworkz - full range developer - likes to start where others gave up - MS MVP alumni and Munich citizen as well
  • Robert Muehsig - Software Developer - from Dresden, Germany, now living & working in Switzerland. Microsoft MVP & Web Geek. -codeinside Blog - Twitter@robert0muehsig

See also the list ofcontributors who participated in this project.

🙋‍♀️🙋‍♂ Contributing

Feel free to submit a pull request if you find any bugs (to see a list of active issues, visit theIssues section.Please make sure all commits are properly documented.

🙏 Donate

We do this open source work in our free time. If you'd like us to invest more time on it, pleasedonate. Donation can be used to increase some issue priority. Thank you!

donate

Alternatively, consider using a GitHub sponsorship for the core maintainers:

Any support appreciated! 🍻

🎉 License

MIT-licensed. SeeLICENSE for details.

Enjoy!

Sponsor this project

  •  
  •  

Packages

No packages published

Contributors61


[8]ページ先頭

©2009-2025 Movatter.jp