Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment