Skip to content

Instantly share code, notes, and snippets.

@deadlydog
Created January 10, 2017 08:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deadlydog/17292d3cd5e6f81409025d843184078e to your computer and use it in GitHub Desktop.
Save deadlydog/17292d3cd5e6f81409025d843184078e to your computer and use it in GitHub Desktop.
Shows how to include part of the ClickOnce version in your application version
public Version ApplicationVersion = new Version("1.11.2");
private void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
// If this is a ClickOnce deployment, append the ClickOnce Revision to the version number (as it gets updated with each publish).
if (ApplicationDeployment.IsNetworkDeployed)
ApplicationVersion = new Version(ApplicationVersion.Major, ApplicationVersion.Minor, ApplicationVersion.Build, ApplicationDeployment.CurrentDeployment.CurrentVersion.Revision);
// Display the Version as part of the window title.
wndMainWindow.Title += ApplicationVersion;
}
@markrivo
Copy link

perfectly done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment