Click Once Application: Parsing Command Line Arguments

How to pass arguments to Click Once application to load project file when user double click on registered file to launch the application deployed by Click Once?

As we know, command line arguments for WinForm application is accessible from

Environment.GetCommandLineArgs()

However, this does not works with Click Once application.
For Click Once application, the command line arguments is available at:

string [] args = AppDomain.CurrentDomain.SetupInformation.ActivationArguments?.ActivationData;

Unlike command line arguments from Environment class where the first argument is the application file path, the first argument in ActivationData array is the argument.

Popular posts from this blog

(AGauge) WinForms Gauge Control - Discontinued

C# DSP Simulation - DSP Lab

WinForms Controls