Skip to content

Instantly share code, notes, and snippets.

@bennlee
Last active August 27, 2019 04:23
Show Gist options
  • Select an option

  • Save bennlee/1a9c2093df3ac10235e07d260236b7e0 to your computer and use it in GitHub Desktop.

Select an option

Save bennlee/1a9c2093df3ac10235e07d260236b7e0 to your computer and use it in GitHub Desktop.

Revisions

  1. bennlee revised this gist Aug 27, 2019. No changes.
  2. bennlee revised this gist Aug 27, 2019. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion electron.NET_quick_start.md
    Original file line number Diff line number Diff line change
    @@ -49,7 +49,6 @@ Task.Run(async () => await Electron.WindowManager.CreateWindowAsync());
    ```

    ## Electronize Init
    다음을 터미널에 입력
    ```
    dotnet electronize init
    ```
  3. bennlee created this gist Aug 27, 2019.
    60 changes: 60 additions & 0 deletions electron.NET_quick_start.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,60 @@
    # 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
    ```