How do I get the current published version in a .NET application?

You can use the following test

if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed) {
    return System.Deployment.Application.ApplicationDeployment.CurrentDeployment.CurrentVersion;
}

to avoid the exception (as detailed in this post).

Also, I don’t think you can get the current publish version via Visual Studio debugging because accessing CurrentDeployment will throw an InvalidDeploymentException.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)