Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parameters in ClickOnce

Tags:

.net

clickonce

Is it possible in any possible way to add to/change the .application file (or another way) of a ClickOnce deploy file to allow parameters to be specified without the need for the parameters to be passed via the URL?

The assembly may be compiled at run time/re-signed/etc, or stated otherwise, I am not worried about the bounds of "what else" I would have to do.

like image 720
Kyle Rosendo Avatar asked Feb 18 '10 10:02

Kyle Rosendo


1 Answers

I asked this question to the ClickOnce product team last month, and they said it can be done. Assuming you are targeting .NET 3.5 SP-1, you can pass arguments in to the appref-ms file (the shortcut on the start menu).

MyApp.appref-ms "my arguments"

Then you can retrieve them using this:

string[] activationData = AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData;
like image 122
RobinDotNet Avatar answered Oct 11 '22 03:10

RobinDotNet