Remove ClickOnce from a WinForms app

给你一囗甜甜゛ 提交于 2019-11-27 15:28:48

问题


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.)


回答1:


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"



回答2:


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)




回答3:


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.




回答4:


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.




回答5:


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!



来源:https://stackoverflow.com/questions/923607/remove-clickonce-from-a-winforms-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!