Noich
Noich

Reputation: 15441

ClickOnce app: Version and settings lost after app restart

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:

  1. The version becomes 1.0.0.0.
  2. The current database setting is set to default (it is in the application's Properties.Settings).

Upvotes: 0

Views: 475

Answers (1)

blachniet
blachniet

Reputation: 4543

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.IsNetworkDeployed will be false. 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.

Upvotes: 1

Related Questions