ElectronNET.CLI 0.0.3

Building cross platform electron based desktop apps with .NET Core and ASP.NET NET Core.
This package contains the dotnet tooling to electronize your application.

There is a newer version of this package available.
See the version list below for details.
Install-Package ElectronNET.CLI -Version 0.0.3
dotnet add package ElectronNET.CLI --version 0.0.3
<PackageReference Include="ElectronNET.CLI" Version="0.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ElectronNET.CLI --version 0.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Electron.NET Logo

AppVeyor (Win/Linux): Build status

Travis-CI (Win/OSX/Linux): Build Status

Build cross platform desktop apps with .NET Core 2.0 and ASP.NET NET Core.

Usage:

To activate and communicate with the "native" (sort of native...) Electron API include the ElectronNET.API NuGet package in your ASP.NET Core app.

PM> Install-Package ElectronNET.API

Program.cs

You start Electron.NET up with an UseElectron WebHostBuilder-Extension.

public static IWebHost BuildWebHost(string[] args)
{
    return WebHost.CreateDefaultBuilder(args)
        .UseElectron(args)
        .UseStartup<Startup>()
        .Build();
}

Startup.cs

Open the Electron Window in the Startup.cs file:

public async void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
    if (env.IsDevelopment())
    {
        app.UseDeveloperExceptionPage();
        app.UseBrowserLink();
    }
    else
    {
        app.UseExceptionHandler("/Home/Error");
    }

    app.UseStaticFiles();

    app.UseMvc(routes =>
    {
        routes.MapRoute(
            name: "default",
            template: "{controller=Home}/{action=Index}/{id?}");
    });

    // Open the Electron-Window here
    await Electron.WindowManager.CreateWindowAsync();
}

Start the Application

For the tooling you will need your dotnet-electronize package ElectronNET.CLI NuGet package. This package must be referenced in the .csproj like this:

    <ItemGroup>
       <DotNetCliToolReference Include="ElectronNET.CLI" Version="*" />
    </ItemGroup>

After you edited the .csproj-file, you need to restore your NuGet packages within your Project. Run the follwoing command in your ASP.NET Core folder:

dotnet restore
  • Make sure you have node.js v8.6.0 and on OSX/Ubuntu the electron-packager installed (via "sudo npm install electron-packager --global")

At the first time, you need an Electron.NET Project initialization. Type the following command in your ASP.NET Core folder:

    dotnet electronize init
  • Now a electronnet.manifest.json should appear in your ASP.NET Core project
  • Now run the following:
    dotnet electronize start

Note

Only the first electronize start is slow. The next will go on faster.

Debug

Start your Electron.NET application with the Electron.NET CLI command. In Visual Studio attach to your running application instance. Go in the Debug Menu and click on Attach to Process.... Sort by your projectname on the right and select it on the list.

Usage of the Electron-API

A complete documentation will follow. Until then take a look in the source code of the sample application: ElectronNET.WebApp

Build

Here you need the Electron.NET CLI too. Type following command in your ASP.NET Core folder:

    dotnet electronize build

In your default setting we just build the application for the OS you are running (Windows builds Windows, OSX builds OSX etc.), but this can be changed with:

    dotnet electronize build win
    dotnet electronize build osx
    dotnet electronize build linux

The end result should be an electron app under your /bin/desktop folder.

Note

An OS X App can only be built on a host OS X platform.

Contributing

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

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
  • Robert Muehsig - Software Developer - from Dresden, Germany, now living & working in Switzerland. Microsoft MVP & Web Geek. - codeinside Blog - Twitter @robert0muehsig

See also the list of contributors who participated in this project.

License

MIT-licensed

Enjoy!

Electron.NET Logo

AppVeyor (Win/Linux): Build status

Travis-CI (Win/OSX/Linux): Build Status

Build cross platform desktop apps with .NET Core 2.0 and ASP.NET NET Core.

Usage:

To activate and communicate with the "native" (sort of native...) Electron API include the ElectronNET.API NuGet package in your ASP.NET Core app.

PM> Install-Package ElectronNET.API

Program.cs

You start Electron.NET up with an UseElectron WebHostBuilder-Extension.

public static IWebHost BuildWebHost(string[] args)
{
    return WebHost.CreateDefaultBuilder(args)
        .UseElectron(args)
        .UseStartup<Startup>()
        .Build();
}

Startup.cs

Open the Electron Window in the Startup.cs file:

public async void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
    if (env.IsDevelopment())
    {
        app.UseDeveloperExceptionPage();
        app.UseBrowserLink();
    }
    else
    {
        app.UseExceptionHandler("/Home/Error");
    }

    app.UseStaticFiles();

    app.UseMvc(routes =>
    {
        routes.MapRoute(
            name: "default",
            template: "{controller=Home}/{action=Index}/{id?}");
    });

    // Open the Electron-Window here
    await Electron.WindowManager.CreateWindowAsync();
}

Start the Application

For the tooling you will need your dotnet-electronize package ElectronNET.CLI NuGet package. This package must be referenced in the .csproj like this:

    <ItemGroup>
       <DotNetCliToolReference Include="ElectronNET.CLI" Version="*" />
    </ItemGroup>

After you edited the .csproj-file, you need to restore your NuGet packages within your Project. Run the follwoing command in your ASP.NET Core folder:

dotnet restore
  • Make sure you have node.js v8.6.0 and on OSX/Ubuntu the electron-packager installed (via "sudo npm install electron-packager --global")

At the first time, you need an Electron.NET Project initialization. Type the following command in your ASP.NET Core folder:

    dotnet electronize init
  • Now a electronnet.manifest.json should appear in your ASP.NET Core project
  • Now run the following:
    dotnet electronize start

Note

Only the first electronize start is slow. The next will go on faster.

Debug

Start your Electron.NET application with the Electron.NET CLI command. In Visual Studio attach to your running application instance. Go in the Debug Menu and click on Attach to Process.... Sort by your projectname on the right and select it on the list.

Usage of the Electron-API

A complete documentation will follow. Until then take a look in the source code of the sample application: ElectronNET.WebApp

Build

Here you need the Electron.NET CLI too. Type following command in your ASP.NET Core folder:

    dotnet electronize build

In your default setting we just build the application for the OS you are running (Windows builds Windows, OSX builds OSX etc.), but this can be changed with:

    dotnet electronize build win
    dotnet electronize build osx
    dotnet electronize build linux

The end result should be an electron app under your /bin/desktop folder.

Note

An OS X App can only be built on a host OS X platform.

Contributing

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

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
  • Robert Muehsig - Software Developer - from Dresden, Germany, now living & working in Switzerland. Microsoft MVP & Web Geek. - codeinside Blog - Twitter @robert0muehsig

See also the list of contributors who participated in this project.

License

MIT-licensed

Enjoy!

Release Notes

Changelog: https://github.com/GregorBiswanger/Electron.NET/blob/master/Changelog.md

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
5.30.0-beta 50 10/14/2019
5.22.14 3,417 7/29/2019
5.22.13 1,117 7/1/2019
5.22.12 1,707 5/20/2019
0.0.11 5,003 12/30/2018
0.0.10 1,082 12/5/2018
0.0.9 11,840 2/19/2018
0.0.8 619 2/14/2018
0.0.7 2,325 11/7/2017
0.0.6 503 11/5/2017
0.0.5 630 10/27/2017
0.0.4 311 10/26/2017
0.0.3 362 10/25/2017
0.0.2 334 10/18/2017
0.0.1 1,297 10/17/2017
Show less