Skip to content

Instantly share code, notes, and snippets.

@bennlee
Last active August 27, 2019 04:23
Show Gist options
  • Save bennlee/1a9c2093df3ac10235e07d260236b7e0 to your computer and use it in GitHub Desktop.
Save bennlee/1a9c2093df3ac10235e07d260236b7e0 to your computer and use it in GitHub Desktop.
Electron.NET Quick Start

Electron.NET Quick Start


프로젝트 생성

원하는 디렉토리로 이동한 후에 터미널에 다음을 입력

With MVC

dotnet new mvc

With Razor 추후 업데이트 예정

dotnet new webapp

ElectronNET.API NuGet Package 추가

dotnet add package ElectronNet.API

DotNet Cli Tool 레퍼런스 추가

왜 필요한지는 아직 의문 (electronize & dotnet electronize)

프로젝트 디렉토리 내의 .csproj 파일을 연 후 다음을 추가

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

.NET Restore

dotnet restore

Program.cs 수정

WebHost builder chain에 Electron 사용하도록 추가

WebHost.CreateDefaultBuilder(args)
	.UseElectron(args)
	.UseStartup<Startup>()
	.Build();

Startup.cs 수정

Startup.cs의 Configure 함수 밑부분에 다음을 추가 (To open electron window on startup)

Task.Run(async () => await Electron.WindowManager.CreateWindowAsync());

Electronize Init

dotnet electronize init

애플리케이션 실행

dotnet electronize start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment