February 2017
Intermediate to advanced
568 pages
14h 19m
English
In .NET, an application has a number of different versions and so, we have a number of alternative ways to access them. The version number that we discussed earlier and is displayed in the Publish Version section of the Publish tab of the project properties can be found using the ApplicationDeployment class from the System.Deployment DLL.
using System.Deployment.Application;
...
private string GetPublishedVersion()
{
if (ApplicationDeployment.IsNetworkDeployed)
{
return ApplicationDeployment.CurrentDeployment.CurrentVersion.
ToString();
}
return "Not network deployed";
}
Note that we need to verify that the application has actually been deployed before we can access the CurrentVersion property of the ApplicationDeployment ...
Read now
Unlock full access