This question comes up quite a bit at PI Square. I know of at least 5 different ways to find out my AF Client version. In a nutshell,
- From the registry settings
- From Programs and Features
- From the file properties in File Explorer
- From PI System Explorer (if also loaded on the client machine)
- From custom code
Let's go over each of these.
Navigate to: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\PISystem\AF Client
Alternative: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\PISystem\AF Client
Programs and Features
Trying to run this may take you to Apps and features. You could filter the list to AF and see something like:
If you really want the Version number, look to the upper right of the window for Programs and Features:
You should then have a list where you may scroll to:
File Properties in File Explorer
Using File Explorer, navigate to: %PIHOME%\AF\PublicAssemblies\4.0
In my example below, %PIHOME% is "C:\Program Files (x86)\PIPC" but this could be a different drive on your machine.
Right-click on the file: OSIsoft.AFSDK.dll
Click on the Details tab along the tab bar at the top.
From PI System Explorer
From the menu bar at the top, click on Help
Click on About PI System Explorer ...
Custom AFSDK Code
From a C# application that has a reference to OSIsoft.AFSDK.dll, you can use:
Or if you already have a using OSIsoft.AF; statement, this shorter version will do:
Or if you despise one-liners, you may try:
var clientSDK = new PISystems();
Console.WriteLine( clientSDK.Version );
For VB.NET, you would use an Imports OSIsoft.AF statement, and this line of code:
And finally, if you're not a developer or don't have Visual Studio, all is not lost. You may still try using Powershell.
$clientSDK = New-Object OSIsoft.AF.PISystems
Write-Host "AF Client Version:" $clientSDK.Version
To produce output such as:
GAC Version Location
--- ------- --------
True v4.0.30319 C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\OSIsoft.AFSDK\v4.0_184.108.40.206__6238be57836698e6\OSIsoft.AFSDK.dll AF Client Version: 220.127.116.1106
There you go. That's at least 5 different ways to get the AF Client Version number. Are there any others that I may have missed?