[英]c# shadowcopy example
I need to update my executable with also the dll linked.. 我需要更新我的可执行文件也与dll链接..
I've read about the AppDomainSetup.ShadowCopyFiles
but I'm in trouble trying the right steps to do what I need 我已经阅读了有关
AppDomainSetup.ShadowCopyFiles
但我在尝试正确的步骤来做我需要的东西时遇到了麻烦
the question are: 问题是:
Creating a shadow copy is not going to update your application. 创建卷影副本不会更新您的应用程序。 The general sequence of auto-updating requires a third application that manages the process.
自动更新的一般顺序需要第三个管理该过程的应用程序。 It looks something like this.
它看起来像这样。
Obviously there is going to be error handling logic built in to this. 显然,内置错误处理逻辑。 But that is the general idea.
但这是一般的想法。 Shadow copies are nowhere in there.
影子副本无处可去。
Making use of the shadow copy feature of .NET is not a bad idea. 利用.NET的卷影复制功能并不是一个坏主意。 It will allow you to update your assemblies without having to exit the application BUT you will need to restart the application in order to run the updated version.
它允许您更新程序集而无需退出应用程序但是您需要重新启动应用程序才能运行更新的版本。 Shadow copy will simply allow you to overwrite the assemblies and nothing else.
卷影副本只允许您覆盖程序集而不会覆盖任何其他内容。
Note that you cannot enable shadow copy on the default AppDomain
. 请注意,您无法在默认
AppDomain
上启用卷影副本。 This means that you will need a loader that will create the AppDomain
, and execute your application. 这意味着您将需要一个将创建
AppDomain
的加载器,并执行您的应用程序。 Have a look at this answer for the steps you need to take and for a simple implementation. 请查看此答案 ,了解您需要采取的步骤以及简单的实施步骤。
If all you want to do is allow updates to be installed without having to exit the application then this is the simplest approach I can think of. 如果你想要做的就是允许安装更新而不必退出应用程序,那么这是我能想到的最简单的方法。
You should also have a look at Microsoft's ClickOnce technology. 您还应该了解Microsoft的ClickOnce技术。 It solves a lot of the common problems of deploying and updating .NET GUI applications.
它解决了部署和更新.NET GUI应用程序的许多常见问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.