Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
358 views
Welcome To Ask or Share your Answers For Others

1 Answer

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/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...