When I talked about .NET internationalisation here I mentioned that the application should be restarted in order to change UI languages. But that code only works when your application allows multiple instances. If you use any technique to make it singleton (only one application instance in the memory), you find the code I provided failed to restart.
Why? Take a look at the original code I published in August,
private static void Restart()
Before the old instance exits, the new instance is already launched. So in the singleton case, no new instance is created and the old instance exits. Aha! You get nothing running.
A side note. You should avoid calling Application.Exit sometimes (especially in multi-threading cases). You may modify Restart to accept a main form reference. Closing the main form by calling Close usually meets your requirement.
Then, how to restart a singleton application? My solution is to bring in a restarter.exe helper executable which is a small and clean console program.
public static void Main(string args)
if (args.Length != 1)
string fileName = args;
} while (Process.GetProcessesByName(Path.GetFileNameWithoutExtension(fileName)).Length > 0);
Restart function should be modified as
static void Restart()
using (Process p = new Process())
p.StartInfo.FileName = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath),
p.StartInfo.Arguments = "\"" + Application.ExecutablePath + "\"";
p.StartInfo.CreateNoWindow = true;
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
Simply place the restarter.exe in the same folder containing your application, and everything should be OK.