Igal Igal - 1 year ago 168
C# Question

Showing ClickOnce deployment version on WPF application

I'm deploying now a WPF c# project and want to put the clickonce version (rather than the assymbly or product version) on the screen title.
I used to do it in Win form application with the following way. But it seems that it is not the way in WPF applications. I search on Google bu didn't find anything. Please help.

if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
ApplicationDeployment ad = ApplicationDeployment.CurrentDeployment;
lblVer.Text = "V" + ad.CurrentVersion.ToString();
lblVer.Text = "V" + Application.ProductVersion.ToString();

Answer Source

OK, I fount the problem. I had to add reference to System.Deployment That is why I couldn't use it. This dll is for winforms also.