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,

 

  1. From the registry settings
  2. From Programs and Features
  3. From the file properties in File Explorer
  4. From PI System Explorer (if also loaded on the client machine)
  5. From custom code

 

Let's go over each of these.

 

Registry Settings

 

Run regedit.exe

Navigate to:    Computer\HKEY_LOCAL_MACHINE\SOFTWARE\PISystem\AF Client

Alternative:     Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\PISystem\AF Client

 

2017-07-19 09_07_09-Registry Editor.png

2017-07-19 09_06_00-Registry Editor.png

 

2017-07-19 09_07_29-Registry Editor.png

 

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:

 

2017-07-19 09_11_51-Settings.png

 

If you really want the Version  number, look to the upper right of the window for Programs and Features:

2017-07-19 09_13_40-Settings.png

 

You should then have a list where you may scroll to:

 

2017-07-19 09_12_46-Programs and Features.png

 

 

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.

 

2017-07-19 09_15_33-4.0.png

 

Right-click on the file:     OSIsoft.AFSDK.dll

 

Click on the Details tab along the tab bar at the top.

 

     2017-07-19 09_16_27-OSIsoft.AFSDK.dll Properties.png

 

 

From PI System Explorer

 

Open PSE

From the menu bar at the top, click on Help

Click on About PI System Explorer ...

 

2017-07-19 09_17_46-About PI System Explorer.png

 

 

Custom AFSDK Code

 

From a C# application that has a reference to OSIsoft.AFSDK.dll, you can use:

 

Console.WriteLine((new OSIsoft.AF.PISystems()).Version);

 

Or if you already have a  using OSIsoft.AF;  statement, this shorter version will do:

 

Console.WriteLine((new PISystems()).Version);

 

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:

 

Console.WriteLine((New PISystems()).Version)

 

And finally, if you're not a developer or don't have Visual Studio, all is not lost.  You may still try using Powershell.

 

[Reflection.Assembly]::LoadWithPartialName("OSIsoft.AFSDK")

$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_4.0.0.0__6238be57836698e6\OSIsoft.AFSDK.dll                             AF Client Version: 2.9.1.8106

 

 

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?