Hi,
We develop an add-in for ArcGIS Pro in .Net / C# which has a custom About screen where among other we display the ArcGIS Pro version.
We followed this snippet (https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Framework#get-arcgis-pro-version) in order to get it but even though I'm running ArcGIS Pro 2.3.3 the version I get with code below is 2.3.0.0.
Assembly.GetEntryAssembly().GetName().Version.ToString();
Could this be a bug in the API or are we doing something wrong?
Thanks,
Gustavo
Solved! Go to Solution.
Hi,
To get the full file version of ArcGISPro.exe, you can try something like this:
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetEntryAssembly();
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
string fileVersion = fvi.FileVersion;
Hi,
To get the full file version of ArcGISPro.exe, you can try something like this:
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetEntryAssembly();
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
string fileVersion = fvi.FileVersion;
Hi Uma,
FileVersion property returned "2.3.3.15900", which is more than I want as I'm trying to display the version in the same way it's shown on ArcGIS Pro's "About" screen.
Changing the last line of the code you provided did the trick:
private string GetProVersion()
{
Assembly assembly = Assembly.GetEntryAssembly();
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
return $"{fvi.ProductMajorPart}.{fvi.ProductMinorPart}.{fvi.ProductBuildPart}";
}
Thank you very much for your help!