ClickOnce部署将保留多个版本(是,两个以上) [英] ClickOnce deployment is leaving multiple versions (yes, more than two)

查看:157
本文介绍了ClickOnce部署将保留多个版本(是,两个以上)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 ClickOnce 应用程序,该应用程序将所有旧版本保留在我的磁盘上.这是一个内部公司应用程序,需要频繁更新,因此对于迅速扩大我们的备份大小来说,这是一场灾难.

I've got a ClickOnce application that is leaving all old versions on my disk. It's an internal corporate application that gets frequent updates, so this is a disaster for rapidly inflating our backup size.

根据文档和其他Stack Overflow问题,应该仅将当前和以前的版本保留在磁盘上.但是,每次我部署项目并升级客户端时,我都会得到所有EXE,DLL和数据文件的另一个副本.我不会对应用程序进行任何更改,只是在Visual Studio中再次推动部署.

According to the documentation and other Stack Overflow questions, it is supposed to only leave the current and previous versions on disk. However, each time I deploy the project and upgrade a client, I get another copy of all EXE, DLL and data files. I'm not making any changes whatsoever to the application, just pushing deploy again in Visual Studio.

如何解决此问题?

该问题似乎在Windows 7和Windows XP以及64位和32位Windows上均会发生.

The problem seems to happen on both Windows 7 and Windows XP, as well as 64-bit and 32-bit Windows.

我已经完成了安装版本的文件夹的比较,并且以下文件有所不同:

I've done a diff of the folders where the version is installed and the following files are different:

MyApp.exe.manifest
MyApp.exe.cdf-ms
MyDll1.cdf-ms
MyDll2.cdf-ms

实际的可执行文件没有不同,MyApp.manifestMyDll1.manifest等也没有.

No actual executable files are different, nor the MyApp.manifest, MyDll1.manifest, etc.

如何选择.在运行时查找包含我的应用程序的其他文件夹是否安全?那会破坏任何东西吗?

How about an alternative. Is it safe to look for other folders containing my application at runtime and delete them? Is that going to break anything?

ClickOnce只是一个明显的神秘黑匣子吗?

Is ClickOnce just an apparent mysterious black box?

推荐答案

我认为我终于找到了这个解决方案.出于某些未知的(坦率地说,这是不可接受的)原因,如果运行新版本,则不会清除较旧版本-它只会以静默方式失败.

I think I've actually finally figured this one out. For some unknown (and unacceptable, frankly) reason, the cleanup of older versions will not happen if the newer version is running -- it just fails silently.

清除尝试在旧版本退出时运行,但是由于我重新启动了该应用程序,因此新版本已经开始,阻止了清除.

The cleanup attempts to run as the old version exits, but because I restarted the app, the new version is already starting, blocking the cleanup.

此外,请注意,其他答案中提到的清道夫服务"似乎完全是捏造的.我找不到任何此类服务的文档,也没有任何运行证据.在clickonce更新过程中,清理似乎是内联进行的.

Also, note that the "scavenger service" mentioned in other answers appears to be a total fabrication. I've found no documentation of any such service, nor any evidence of it running. The cleanup appears to happen inline as part of the clickonce update process.

这篇关于ClickOnce部署将保留多个版本(是,两个以上)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆