Usually Visual Studio will tell you how to correct any missing using statements if you've correctly referenced the afsdk dll in your project. If they are not resolving there's probably something wrong about your reference. I also believe they might be case sensitive. See the following post for more details.
Yup. I know that. Been coding against the AF sdk for a long time... However, always used to get pi stuff, tags, and time series data using the pi sdk.
This is what I've been using and I'm curious about the more recent code snippets from the AF sdk:
//PISDK.PISDK pi = new PISDK.PISDK();
//Server server = pi.Servers["MYPISERVER"];
//PointList pointsList = server.GetPoints("tag = 'someTag'");
When I reference the af sdk, there's no PIServer nor PIPoint in my Osisoft.Af.Pi.* namespace.
I have the Osisoft.AFSDK 184.108.40.20652 from 12/6/2017 and the Osisoft.PISDK 220.127.116.114 from 8/19/2016
All I want is the referenced 4 lines of code (getting server and filtered listing of pi tags) - with the referenced dll and the using statements.
1 of 1 people found this helpful
Am I understanding that you have the AFSDK and PI SDK referenced in your project? Could possibly be some name collisions. You shouldn't have to mix and match PI SDK and AFSDK -- everything you need should be encompassed in the AFSDK. What happens when you remove the reference to PI SDK? This is pretty boilerplate stuff so the fact that the namespaces don't resolve means that there is something wrong further up in the project.
Because the other question has a [Correct Answer] and your's is a new one, I have branched it. I hope the title is appropriate for what you are asking.
AF SDK exists in 2 flavors, the legacy one which uses PI SDK under the hood and the one also referred to as Rich Data Access (RDA). The RDA version shows with Version 4.0.0. while the legacy one identifies itself with 18.104.22.168.
Please make sure you pick the RDA version which you will find under Assemblies -> Extensions and once you've used it under Assemblies -> Recent too.
Depending on what objects, methods you use, you require adding the corresponding namespaces to your Visual Studio project unless you fully qualify objects and methods. Please refer to the overview of namespaces in the AF SDK Reference. OSIsoft.AF.PI offers the equivalents to objects and methods you know from PI SDK. When dealing with time series data, you may also require OSIsoft.AF.Time and OSIsoft.AF.Data. When working asset centric, you need at least OSIsoft.AF and OSIsoft.AF.Asset.
To me using AF SDK Reference at Live Library comes pretty handy but it may take some time until you get used to it. You are very welcome to ask further information. Many things can be done in different ways but not all of the available options are equal e.g. with regards to performance and efficiency.