Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine if App is running as a 'clickonce' application

Tags:

c#

clickonce

I am in the process of writing a library (c# .net 4.0) for use in a number of applications. One of the requirements is that the library returns slightly different results to calls depending on whether or not the application is deployed and running via clickonce.

I've had a search around but cannot find any way that an assembly can determine if the 'hosting' application is clickonce deployed.

Any pointers would be appreciated.

like image 805
Ash Avatar asked Dec 19 '10 18:12

Ash


1 Answers

Add reference to System.Deployment, after that you can use:

Application.ApplicationDeployment.IsNetworkDeployed

If you need to pass arguments to application, then use:

var args = AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData;
like image 82
The Smallest Avatar answered Sep 28 '22 08:09

The Smallest