自动更新WinForms应用程序 [英] Auto update for WinForms application
问题描述
为.NET WinForms应用程序创建自动更新功能时,它如何更新DLL并且不影响当前正在运行的应用程序?
When creating an auto updating feature for a .NET WinForms application, how does it update the DLLs and not affect the currently running application?
由于应用程序在更新过程中正在运行,因此不会对DLL施加任何锁定(因为这些DLL必须在更新过程中被覆盖).
Since the application is running during the update process, won't there be a lock on the DLLs (because those DLLs will have to be overwritten during the update).
推荐答案
通常,您会将新文件下载到单独的区域中.然后关闭并重新启动,并在启动时查找并使用新文件(如果找到).始终保留最后一个已知的工作版本,以便用户在下载导致问题时可以恢复到一定可以正常工作的版本.
Usually you would download the new files into a separate area. Then shutdown and restart and at startup you look for and use the new files if found. Always keeping a last known working version on the side so that the user can revert to something that definitely works if the download causes problems.
ClickOnce是Microsoft的一项优秀技术,可以为您执行此操作,您可以直接在Visual Studio 2008中使用它.
ClickOnce is a good technology from Microsoft that does this for you and you can use it directly from Visual Studio 2008.
这篇关于自动更新WinForms应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!