Restart WPF application after click-once update (start the new version)

后端 未结 6 2124
一整个雨季
一整个雨季 2020-12-14 02:24

How to restart WPF application after it has been updated using click-once, i need to start the new version!

6条回答
  •  猫巷女王i
    2020-12-14 03:11

    There are a few ways but most don't work correctly, they end up reopening the old version.

    It's going to sound crazy that WPF doesn't have a proper way to handle it (#fixwpf), but you'll need to reference System.Windows.Forms.dll and call System.Windows.Forms.Application.Restart();

    A quick search found Rob Relyea's post about the same thing (XAML, WPF Microsoft Guy) http://robrelyea.wordpress.com/2007/07/24/application-restart-for-wpf/

提交回复
热议问题