Hello
Im using this code to get propiertes of elements and it's working with Nam/protocol but when i try to get AdvancedSettings i get this error.
(34,18): warning CS1701: Assuming assembly reference 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' used by 'Interop.SLDms' matches identity 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' of 'mscorlib', you may need to supply runtime policy (50,7): warning CS1701: Assuming assembly reference 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' used by 'Interop.SLDms' matches identity 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' of 'mscorlib', you may need to supply runtime policy (102,42): error CS1061: 'IDmsElement' does not contain a definition for 'AdvancedSettings' and no accessible extension method 'AdvancedSettings' accepting a first argument of type 'IDmsElement' could be found (are you missing a using directive or an assembly reference?) 2021/09/03 14:33:07.747|SLManagedScripting.exe|ManagedInterop|ERR|-1|113|No CodeBuilder found for cookie0 2021/09/03 14:33:07.748|SLProtocol - 4620 - Manage|14156|CQAction::Run|ERR|-1|QAction [3] triggered by [pid=100/idx=-1/pk=/user=] failed. (0x80040221) Input: new = <NULL> Input: old = <NULL> Input: extra = <NULL>
his is the code:
IDms myDms = protocol.GetDms();
IDma agent = myDms.GetAgent(protocol.DataMinerID);
ICollection<IDmsElement> elements = agent.GetElements();
foreach (IDmsElement element in elements)
{ .....
var1=element.Name; //works ok
var2=element.AdvancedSettings.IsHidden; //get error
......}
PD: I know that i could use "dms.GetInfo(8/*DMS_GET_INFO*/ , 0, ref data)" but IDms look more clean.
Im using Dataminer 10.1.3.0-9963
Thanks
Hi Juan, I'm not sure if your problem is equal to mine, but I have encountered similar behaviour, seeing the message 'does not contain a definition for'. For me, the class library feature was enabled but was not set to automatically update. In the background, only the relevant parts of the library are included. Code that is irrelevant for the actions you take is thus excluded. If there is a new type/class used in your script and the library code is not automatically included/updated then you might have that error.
If this is the error you are experiencing, you can either set the library to automatically update (1) or update manually (2).
(1)
(2)
Thanks a lot, it works!!