使用Visual Studio构建的ClickOnce中的部分应用程序更新 [英] Partial application updates in ClickOnce using Visual Studio build

查看:135
本文介绍了使用Visual Studio构建的ClickOnce中的部分应用程序更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用VS2008通过ClickOnce发布我的应用程序文件。我在某处读到,ClickOnce只会智能地进行部分更新;这意味着,如果文件在后续更新中已更改,则仅从网络共享下载文件。但是,这对我不起作用。所以我做了一些研究,偶然发现了这篇MSDN文章- http://msdn.microsoft .com / en-us / library / ms404267.aspx 。它表示,如果我们使用VS进行构建,则不会执行部分更新。谁能告诉我为什么会这样吗?如果是这样,有没有办法让引用的dll只在第一次下载。我正在使用Microsoft Practices Enterprise Library和一些第三方控件(带有巨大的Theme文件)。

I am using VS2008 to publish my application files using ClickOnce. I read somewhere that ClickOnce intelligently does only partial updates; meaning it only downloads files from the network share if the file has changed in subsequent updates. However, this wasn't working for me. So I did some research and stumbled upon this MSDN article - http://msdn.microsoft.com/en-us/library/ms404267.aspx. It says that if we build using VS, it doesn't perform the partial updates. Can anyone tell me why this is the case? If so, is there a way to atleast let the referenced dlls to be downloaded only for the first time. I am using Microsoft Practices Enterprise Library and some 3rd party controls (with huge Theme files).

谢谢,
Uniball

Thanks, Uniball

推荐答案

部分更新有效即使在VS中构建,也可以在ClickOnce中使用。但是,如果您的解决方案由几个项目(例如,几个类库项目和一个可执行文件)组成,那么无论何时重新构建所有项目,即使文件没有更改,程序集文件上的时间戳也会改变。由于ClickOnce实际上仅查看时间戳来确定文件是否需要更新,因此它将在用户更新时将(未更改的)程序集作为新文件下拉。

Partial updates work fine in ClickOnce even when building in VS. However, if you have a solution made up of a few projects (eg a couple of class library projects and an executable) then any time you rebuild all the projects the timestamp on the assembly files will change, even if the code hasn't. Since ClickOnce really only looks at the timestamps to decide whether a file needs updating, it'll pull down the (unchanged) assemblies as new files when the user updates.

解决方法是将任何相关项目从可执行文件的解决方案文件中拉出并分别构建它们。这意味着任何代码不经常更改的程序集只会被下拉一次到客户端。如果您需要更改程序集,只需打开其解决方案并进行更改,然后重新打开可执行文件的解决方案并重新生成它即可。下一次ClickOnce更新将同时删除exe文件和更改的程序集。

The workaround is to pull any dependent projects out of your executable's solution file and build them separately. That means that any assemblies whose code doesn't change very often will only get pulled down to the client once. If you need to change the assembly, you simply open its solution and make the change, then reopen your executable's solution and rebuild that. The next ClickOnce update will pull down both the exe and the changed assembly.

希望这很清楚!

这篇关于使用Visual Studio构建的ClickOnce中的部分应用程序更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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