AnsweredAssumed Answered

How to connect to PI Server hosted on a separate machine using AF SDK

Question asked by yusuf_shaikh on Jul 6, 2020
Latest reply on Jul 6, 2020 by yusuf_shaikh

Hi Team,


I need to create a web API that should connect to PI server not AF server and fetch tags values.

I am using the following code to connect to PI server :-

PIServer myPIserver = new PIServers()["Test"]
But i am getting the following error :-
Message=Could not load file or assembly 'OSIsoft.PI.Configuration, Version=, Culture=neutral, PublicKeyToken=c3309f0734ba2805' or one of its dependencies. The system cannot find the file specified.
at OSIsoft.AF.PI.PIServersGlobal.Load(Boolean force)
at OSIsoft.AF.PI.PIServersGlobal..ctor(PISystemsGlobal systems)
at OSIsoft.AF.PISystemsGlobal.get_PIServers()
at OSIsoft.AF.PI.PIServersGlobal.GetPIServers(PISystemsGlobal systems)
at OSIsoft.AF.PI.PIServers..ctor()
at Console_App_For_PI_Tags.Program.Main(String[] args) in C:\Users\piadmin\source\repos\Console_App_For_PI_Tags\Console_App_For_PI_Tags\Program.cs:line 17
Please let me know what should be approach, thanks in advance