2012-01-30 2 views
1

현재 응용 프로그램을 업그레이드하기 위해 응용 프로그램을 다시 시작하고 싶습니다. 이를 위해 아래에 언급 된 두 줄의 코드를 사용하고 있습니다.WPF에서 응용 프로그램 다시 시작

System.Windows.Forms.Application.Restart(); 

Process.GetCurrentProcess().Kill(); 

또는

System.Windows.Forms.Application.Restart(); 

Application.Current.Shutdown(); 

그러나 이것은 " An unhandled win32 exception is occurred"의 오류 메시지를주고있다. 그러므로 이것은 작동하지 않습니다.

도움이 될 것입니다.

+0

가능한 중복 http://stackoverflow.com/questions/4773632/how-do-i-restart-a- wpf-application) –

+0

예외에 대한 스택 추적 게시는 시작일 수 있습니다. Win32 예외를 던지고있는 것은 무엇입니까? –

+0

안녕하세요 코디 그레이, 내가 [링크] (http://stackoverflow.com/questions/4773632/how-do-i-restart-a-wpf-application)이 링크를 시도했습니다. 그러나 이제는 "응용 프로그램 개체가 종료되고 있습니다."라는 오류가 표시됩니다. – Prasanta

답변

0

시도해 보셨습니까?

Application.Restart(); 

또는

System.Diagnostics.Process.Start(Application.ExecutablePath); 
Application.Exit(); 
[I는 WPF 응용 프로그램을 다시 시작하려면 어떻게합니까?] (의
관련 문제