46

I have a WinForms application that was going to use ClickOnce. But it turns out ClickOnce won't work for my application, so I'd like to remove it. Only...there doesn't seem to be an obvious way to do this. There's no "Un-ClickOnce" button. Does anybody know what steps I need to take to get my app to be like it was before ClickOnce integrated itself?

(I know I can create a new project and import stuff into it, but it seems silly to have to do that, so I'm hoping there's another way.)

Ryan Lundy
  • 204,559
  • 37
  • 180
  • 211
  • 1
    What is it about ClickOnce that has "infected" your program? You don't "remove" ClickOnce from an app, you just decide not to use it and deploy another way. – Matt Hamilton May 28 '09 at 22:59

5 Answers5

120

Other responses here are not correct or helpful. It is incorrect to state that it never needs removing.

One such example I experienced recently was when the application had a need for administrative privileges. Any attempt to embed administrative requirements into the manifest will result in the application not even compiling while ClickOnce is still present in the solution.

The following two steps enabled me to turn off ClickOnce (in Visual Studio 2010):

In the project properties,

  1. Signing tab: Untick "Sign the ClickOnce manifests"
  2. Security tab: Untick "Enable ClickOnce security settings"
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Chris Rogers
  • 1,773
  • 1
  • 15
  • 18
  • 5
    Thanks. For me, I don't want unnecessary files going into a build because they will then, likely, be copied out to other machines, etc. It's just cleaner when you can NOT have them if you're NOT using them! – Josh M. Jan 24 '12 at 15:53
  • How is 1.) possible if there are DLL files in the project (ref. *[How to not sign a ClickOnce manifest](http://stackoverflow.com/questions/229373/how-to-not-sign-a-clickonce-manifest/229795#229795)*)? Does 2.) enable it in that case? – Peter Mortensen Nov 14 '13 at 09:34
  • I came across this because one of my Windows Service projects had an app.publish directory with the single .exe file in it. The instructions above (uncheck Signing/ClickOnce and Security/ClickOnce) got rid of the directory. – William T. Mallard Nov 22 '14 at 19:24
  • 2
    Greetings from the future. Note for **VSTO** deployed by ClickOnce, there is **no** `Security` tab –  Mar 16 '16 at 06:33
  • I had copied code to another machine and was getting a 'SignTool.exe not found.' error when trying to build. Evidently "ClickOnce Publishing Tools" is a checkbox in the Visual Studio 2015 Install/Modify options. ClickOnce was not a fit for this program so the info on removing it from the project properties over running a modify setup on Visual Studio was helpful. Thanks – eric1825 Apr 15 '16 at 16:22
1

If you refer the the ClickOnce Application Deployment Manifest files that appear in your Debug folder, go to Project Properties -> Security and uncheck 'Enable ClickOnce Security Settings'

You can also go to Project Properties -> Signing and uncheck 'Sign the ClickOnce manifests', but this is not necessary because it does not have what to sign if you do the first uncheck.

Now if you go to debug and delete .application files, at rebuild, there will not appear again.

Gabriel Diaconescu
  • 1,769
  • 3
  • 21
  • 31
1

I believe the only thing that is left from ClickOnce once you stop deploying it is file publish.xml that tells you about what you have deployed thus far and what version you are at. Otherwise there is really nothing there that need concern you, just deploy from the bin folders as you would without ClickOnce.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Brandon Grossutti
  • 1,241
  • 5
  • 16
  • 24
1

I agree with the others, there is no need to "remove ClickOnce".

If you are really going for it though, IIRC all ClickOnce settings are in the .csproj file for the project, so remove all XML tags there that relate to ClickOnce. (maybe easiest to compare to a new app that hasn't been deployed with CO ever to see what tags are not there)

andyhammar
  • 1,443
  • 13
  • 19
0

Just in case this helps anyone...

My problem was specifically that I had a dependant "Class Library" project that had the "sign the clickonce manifest" checked but disabled so it could not be unchecked. My solution was to:

  • Convert that project to a windows app,
  • Re-open the properties panel,
  • Remove the click once manifest signing from the signing tab on the properties panel,
  • Convert the project back to a "Class Library".

I consider it an MS bug (still in VS2019 16.0.1 which I'm using now) but the workaround fixed it.

Good Luck!