mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
Get path to the file that launched the application #697
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MSiffert on GitHub (Sep 8, 2021).
Originally assigned to: @GregorBiswanger on GitHub.
Considering we have one for more file associations inside our
electron.manifest.jsonThere should be an API inside the Electron API to see how the App was launched.
Environment.GetCommandLineArgs()does not contain any information about the file that launched the application because these parameters are not passed to the dotnet process by the Electron host.Environment.GetCommandLineArgs()will always only include the following parameters:This is extremely common for desktop applications and should, at least in my opinion, be an essential feature.
Note: I am using .NET 5 and Blazor Server
@GregorBiswanger commented on GitHub (Mar 28, 2023):
🎉🚀 New Electron.NET version 23.6.1 released 🚀🎉
With native Electron 23 and .NET 6 support. Your problem should be fixed here. If you continue to have the problem, please let us know. Please note the correct updating of your API & CLI. Info in the README. Have fun!