Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6734803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:55:57+00:00 2026-05-26T10:55:57+00:00

I would like to have my current application close and restart. I have seen

  • 0

I would like to have my current application close and restart. I have seen many posts on this, however none of these seem to work for me.

I have tried

 System.Diagnostics.Process.Start(System.Windows.Application.ResourceAssembly.Location);
 System.Windows.Application.Current.Shutdown();

However this only restarts the application once. If I press my ‘restart’ button again (on the already restarted app), it only closes.

I have also tried launching a new System.Diagnostics.Process and closing the current process, but again this does not restart, it simply closes.

How can I restart my current WPF application?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:55:58+00:00Added an answer on May 26, 2026 at 10:55 am

    You could create another application which you start when exiting your app and which in return does start your application again. Kind of like how a patcher would work, only without patching anything. On the plus side you could have a loop in that “restart-application” which checks all running processes for your main application process and only tries to re-start it once it does not appear in the process any longer – and you got the bare bones for a patcher also 🙂 Whilst you do not seem to have a problem with restarting your application due to it still being in the processlist – it is the way I would go for when doing it in a production environment as this gives you the most control IMHO.

    Edit:

    That part in the button event handler (or wherever you want to restart your app with) of your main app (Process2BRestarted.exe in my case):

        private void cmdRestart_Click(object sender, EventArgs e)
        {
            var info = new ProcessStartInfo();
    
            info.FileName = "ProcessReStarter";
            info.WindowStyle = ProcessWindowStyle.Hidden;
            Process.Start(info);
    
            Application.Exit();
        }
    

    This should go into your utility/restarter application (ProcessReStarter.exe over here):

        private void MainForm_Load(object sender, EventArgs e)
        {
            // wait for main application process to end
            // really should implement some kind of error-checking/timer here also
            while (Process.GetProcessesByName("Process2BRestarted").Count() > 0) { }
            // ok, process should not be running any longer, restart it
            Process.Start("Process2BRestarted");
            // and exit the utility app
            Application.Exit();
        }
    

    Clicking the restart button will now create a new process ProcessReStarter.exe, which will iterate through the process list of all running processes – checking whether Process2BRestarted is still running. If the process does not appear in the list (any longer) it will now start a new Process2BRestarted.exe process and exit itself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am hosting SpiderMonkey in a current project and would like to have template
I would like to have App_LocalResources folder outside web application folder, so that I
I have written an SWT Java application and would like to configure it to
I have used this tutorial to make a website, but I would like that
I have one problem when developing iphone application. I would like to know if
I have a problem that I would like have solved via a SQL query.
So in my project i would like have a nice treeview that has images.
I would like to have it so that when I play one Vimeo video
I would like to have a drag-and-drop feature based on images. If I drag
I would like to have a Referral model, where user A can refer an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.