Skip to content

MacOS Single Instance Issue - Can't Open New Window #1040

@AeonSake

Description

@AeonSake

The single-instance option for macOS seems to not work as intended (or I misunderstood something in the configuration). By default, new Electron.NET projects are built as single-instance electron apps, unless specified in the project properties. However, at least under macOS, this behavior is not fully working. When starting the app (from the publish results), it will correctly mount as a single-instance app. However, you cannot get it to create a new window when either:

  • Clicking/starting the app again while it is running
  • Clicking the app icon in the dock (even when no other window is open)

Furthermore, the app doesn't automatically close when all windows are closed and requires manual closing (via CMD+Q or menu). From other electron apps I know that you need to manage the single-instance behavior in the main.js yourself, which, I assume, is done automatically in Electron.NET. Therefore, I suspect there might be an issue with the code there (which I admittedly haven't looked at yet). Am I doing something wrong or is the behavior indeed incorrect?

  • NuGet Version: 0.4.1
  • Electron Version: 41.0.3
  • Electron Builder Version: 26.8.1
  • Framework: net10.0
  • Target: osx-arm64 (specified via publish profile)
  • IDE: Visual Studio Code 1.111.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions