ElectronNET / Electron.NET

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

Home Page:https://gitter.im/ElectronNET/community

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

App.OpenFile never called

Cedric-LE opened this issue · comments

Using electron net 23.6.1

.NET core 7.0.203 and node v16.20.2

  • Target: Windows 10

I want to perform an action when launching the application by double-clicking on a file from the explorer.
I've added a callback to the OpenFile event on the App to obtain the path to the file passed as an exe argument. The callback is never called.

I did something like that.

        ElectronNET.API.Electron.App.OpenFile +=  Console.WriteLine;

        // await window
        var window = await ElectronNET.API.Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions
        {
          Title = "My App",
          AutoHideMenuBar = true,
          Width = 1200,
          Height = 800,
        });