OSI PI reference is not showing in visual studio 2019
OSI PI reference is not showing in visual studio 2019
First, you must be using .NET Framework, preferably .NET Framework 4.8. If you are attempting to use .NET 5 through 8, then you cannot add the reference to your project.
Backing up a step, make sure that you have properly installed the AF Client, which will install all .NET Framework related AF SDK DLL's.
Actually Rick, they may have made a change in how VS works because you can reference Framework projects, or the AF SDK directly and everything works from an IntelliSense perspective, it just won't run of course.
That being said, sometimes the DLL doesn't show up and you have to browse to it in VS. For me, it's at "E:\Program Files (x86)\PIPC\AF\PublicAssemblies\4.0\OSIsoft.AFSDK.dll". For you, there's a good chance it's at the same spot, but on the C drive. If it's not there, then make sure you install the Client tools as Rick mentioned.
Do we need to install visual studio in same system where PI AF is present.
Just guessing when you say "PI AF" that you mean the AF Server, i.e. PISystem. The answer is NO. You will need to PROPERLY install the AF Client on the same PC where you have Visual Studio installed. And again, AF SDK is (at present) restricted to .NET Framework.
so what will be the alternate way to connect .net framework with PI system. Is there any guide or tutorials available?
This link contains the link by Asle as well as 2 other important links:
https://docs.aveva.com/category/af-sdk
The first link is the AF SDK Reference guide.
The last link is the AF SDK Getting Started guide.
Your PI Data Archive can be on a separate host than your AF Server. Your Visual Studio development PC can, and honestly SHOULD, be on a different host as well.
The important thing for you yet again is that you must properly install the AF Client on your Visual Studio PC. Do not try to just copy DLL's.
AshutoshDandsena Have a look here, to see a bunch of examples on getting started accessing PI data programmatically: https://github.com/AVEVA/AVEVA-Samples-PI-System?tab=readme-ov-file