Using the code below (AFSDK 2.6), we read an XML file (myLibraryFile.xml) that contains the definitions of AFElementTemplates and AFEnumerations.
myLibrary = afDatabase.PISystem.Libraries.Add("myLibraryFile.xml", "My.Library"); afDatabase.PISystem.CheckIn(); myLibrary.Import(afDatabase); afDatabase.CheckIn();
This works, but we have a requirement that the attribute names need to be translated into different languages. Testing with Cyrillic characters, the error occurs:
A first chance exception of type 'System.OperationCanceledException' occurred in OSIsoft.AFSDK.dll Additional information: Error occurred on line 332, column 9, near 'AFAttributeTemplate' while processing Element Template 'My.Element.Template': An invalid character '?' was used in the name '????????? ??????? ??????'. Parameter name: name
Using the same file (myLibraryFile.xml), I can use PI System Explorer and import the file to create AFElementTemplates and AFEnumerations -- and the Cyrillic characters are imported successfully. Is there a different function that I should be using through the AFSDK to successfully read and import the XML file that contains Cyrillic characters?