ClickOnce 部署留下多个版本(是的,不止两个) [英] ClickOnce deployment is leaving multiple versions (yes, more than two)

查看:24
本文介绍了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.

根据文档和其他 StackOverflow 问题,应该只将当前和以前的版本保留在磁盘上.但是,每次我部署项目和升级客户端时,我都会得到所有 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.

我该如何解决这个问题?

How do I fix this problem?

该问题似乎在 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天全站免登陆