Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi,

I don't use Assembly Version, so I'd like to know I can get the ClickOnce Version in an WPF c# Program.

When I use the Following Code:
C#
if (ApplicationDeployment.IsNetworkDeployed)
{
    Version version = ApplicationDeployment.CurrentDeployment.CurrentVersion;
}

I get get the following Error:

The name 'ApplicationDeployment' does not exist in the current context

I already tried to implement System.Deplayoment, but it didn't worked :/

Please Help, thanks.
Posted

 
Share this answer
 
Comments
[no name] 23-Dec-14 17:01pm    
Thanks, it worked :)
Okay, i know why it didn't worked.

I thought c# is diffrent when using WPF instead of WinForms, bhut it didn't.

my Code was correct, but i forgot to add the System.Deployment.dll as Resource.

Thanks to Mehdi Gholam for the useful Link! :)
 
Share this answer
 
Comments
Afzaal Ahmad Zeeshan 23-Dec-14 17:38pm    
If his link worked, you needed to mark his solution as an answer not post a new answer and then mark it as an answer.
[no name] 2-Jan-15 7:20am    
Where do I mark the Solution as answered?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900