triadabond.blogg.se

Electron set icon
Electron set icon













electron set icon

Locate the Configure method and add the following lines to the end of its body: if (HybridSupport.IsElectronActive)įinally, add the following method to the Startup class to create the main Electron window: private async void CreateWindow() The second is convenient during development, as it allows detailed error messages to be displayed.Įdit Startup.cs and insert the following using statement: using ElectronNET.API WebBuilder.UseEnvironment("Development") Locate the static method CreateHostBuilder and insert the following two lines before the call to UseStartup: webBuilder.UseElectron(args) Next, edit Program.cs and insert a using statement for the newly added package: using ElectronNET.API This restore gives you immediate access to Intellisense for subsequent modifications to the code. Save the file, then restore packages when prompted to do so by VS Code. First, open the file BlazorApp.csproj and insert a package reference for the Electron.NET API–hosted on : This involves adding a NuGet package to the project file, inserting some initialization code, and installing a command-line tool to perform builds. Let's turn our boilerplate Blazor project into a desktop Electron application. Close the page, return to VS Code, and stop debugging. Press F5 to build and run the application, then open a browser on localhost:5001 to view the default Blazor page. When prompted by Visual Studio Code, say Yes to load the required assets for the project. First, open a terminal window and run the following commands to create a new project called BlazorApp.

Electron set icon code#

NET Core command-line extension that builds and launches applications for Windows, macOS, and Linux platforms.Įlectron.NET requires the prior installation of the following software:įollow the steps below and get started by building the canonical Blazor application from the command line.įor this exercise, I'm using Visual Studio Code running on a Mac. A NuGet package that adds Electron APIs to an ASP.NET Core or Blazor project.NET developers to invoke native Electron APIs using C#. It leverages familiar standards such as HTML, CSS, and JavaScript.Įlectron.NET allows. Supported operating systems include Windows, macOS, and Linux.

electron set icon

  • Building deployment media for other platformsĮlectron is a framework that supports the development of desktop applications using web technologies such as the Chromium rendering engine and the Node.js runtime.
  • Implementing native UI elements such as message boxes.
  • Using Visual Studio Code to debug Blazor pages.
  • Modifying the default Blazor Server application to use Electron.NET.
  • This blog post illustrates how you can apply the same techniques to create Blazor desktop applications. By providing a wrapper around a standard Electron application with an embedded ASP.NET Core website, Electron.NET allows C# developers to target multiple platforms without coding in JavaScript. I wrote about using the open-source tool Electron.NET to implement cross-platform desktop applications for Windows, macOS, and Linux platforms in a previous blog post.















    Electron set icon