Starting my first RDA SDK development (a custom DR to aggregate bad quality from a PIPoint AF attribute), i got stuck on square one.
First, i have the AF Client 2012 SP1 installed on my x64 machine (yes, did uninstall and re-install and checking in between that is has gone). This gives me the new AFSDK in C:\Program Files (x86)\PIPC\AF\PublicAssemblies. When i take a look at the OSIsoft.AFSDK.dll properties, that states version 22.214.171.12459. That would need to be the correct and latest version.
Now i fire up my VS2010, and load my solution. The solution is targeting the .NET4 framework and compiling against anyCPU. I add a reference to the .NET OSIsoft.AFSDK.
I include the following Using statements, all give no problems, and are nicely recognized by the tooltips and giving no compile errors:
using OSIsoft.AF; using OSIsoft.AF.Asset; using OSIsoft.AF.Time; using OSIsoft.AF.Data; //This namespace only exists in .NET 4.0 version using OSIsoft.AF.PI; //This namespace only exists in .NET 4.0 version
When i now get to my code:
AFAttribute sourceAFAttribute = AFAttribute.FindAttribute(configString, this.Database); resultValue.Value = sourceAFAttribute.Data.RecordedValue(resultValue.Timestamp, OSIsoft.AF.Data.AFRetrievalMode.AtOrBefore, sourceAFAttribute.DefaultUOM);
I get the following errors:
- On sourceAFAttribute.Data: 'OSIsoft.AF.Asset.AFAttribute' does not contain a definition for 'Data' and no extension method 'Data' accepting a first argument of type 'OSIsoft.AF.Asset.AFAttribute' could be found (are you missing a using directive or an assembly reference?)
- On OSIsoft.AF.Data.AFRetrievalMode: The type or namespace name 'AFRetrievalMode' does not exist in the namespace 'OSIsoft.AF.Data' (are you missing an assembly reference?)
I just can't get my head around the issue, as on one side it seems to find the new namespaces, but on other locations it does not. Anyone any ideas? Maybe a call for a support ticket?