I have a C#/WPF app that uses ClickOnce for deployment. There is a scenario where the app needs to restart (the user changes a database). I do it by:
System.Diagnostics.Process.Start(System.Windows.Application.ResourceAssembly.Location);
System.Windows.Application.Current.Shutdown();
After restart, it seems that the app has issues:
- The version becomes 1.0.0.0.
- The current database setting is set to default (it is in the application’s Properties.Settings).
I don’t know that I fully understand the question, but I do know there is an issue with the method you are using to restart the application if it is a ClickOnce application. When you restart the application this way,
ApplicationDeployment.IsNetworkDeployedwill befalse. See this post for a full explanation: http://bit.ly/RKoVBz.I haven’t verified the proper way to restart the application yet, but I’ll update this a soon as I do.