Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging ClickOnce deployment functions

I'm deploying a C# .NET application using ClickOnce and I have written code to update the application programatically (not using the option in the publish settings of the project).

However I want to test the functionality of this code before deploying (for obvious reasons). How do I do this? The code has a check to see if the application is network deployed and when running debugging sessions this flag is false. And accessing ApplicationDeployment.CurrentDeployment results in an exception being thrown.

like image 604
Kristoffer L Avatar asked Aug 26 '09 11:08

Kristoffer L


People also ask

How do I debug ClickOnce application?

To debug this, simply attach before the button is pressed, then set a breakpoint (make sure that you open the appropriate archived file and set the breakpoint there). Use the IsNetworkDeployed property to invoke the System. Deployment.

How do I ClickOnce deployment?

In the Publish wizard, select Folder. In the Specific target page, select ClickOnce. Enter a path or select Browse to select the publish location. In the Install location page, select where users will install the application from.

Is ClickOnce still supported?

ClickOnce and DirectInvoke are supported out of the box for all Windows users. Users that want to disable ClickOnce support can go to edge://flags/#edge-click-once and select Disabled from the dropdown list. You'll have to Restart the browser.

Does ClickOnce require admin rights?

Windows Installer deployment requires administrative permissions and allows only limited user installation; ClickOnce deployment enables non-administrative users to install and grants only those Code Access Security permissions necessary for the application.


1 Answers

You can to debug it after adding such code:

System.Diagnostics.Debugger.Launch();

This will show you a dialog that allows you to select your debugger to attach to.

like image 118
Oleg Kyrylchuk Avatar answered Sep 22 '22 01:09

Oleg Kyrylchuk