fayrehouse
12 years agoFrequent Contributor
System.Collections.Specialized.StringCollection ??
Hi All,
I have an object in our AUT that has a method that takes an object of the above type as a parameter.... And I'm having trouble defining an object of that type.
Can anyone correct me below?
var myAssessments;
myAssessments = dotNET.System.Type.GetType("System.Collections.Specialized.StringCollection");
myAssessments.add("AA000191");
FWIW, I have System.Collections (from the GAC) listed in the CLR Bridge page of the project properties.... Don't think that's made any difference though!
What do I need to change to have an object of type "Specialized.StringCollection" - and how to add strings to it?
Thanks
Steve
I have an object in our AUT that has a method that takes an object of the above type as a parameter.... And I'm having trouble defining an object of that type.
Can anyone correct me below?
var myAssessments;
myAssessments = dotNET.System.Type.GetType("System.Collections.Specialized.StringCollection");
myAssessments.add("AA000191");
FWIW, I have System.Collections (from the GAC) listed in the CLR Bridge page of the project properties.... Don't think that's made any difference though!
What do I need to change to have an object of type "Specialized.StringCollection" - and how to add strings to it?
Thanks
Steve
- Hi Steve,
With TC 9.20 after adding "System, version=4.0.0.0, ..." to the CLR bridge, the following works:
function testTypeCollectionFromDotNet()
{
var myAssessments = dotNET.System_Collections_Specialized.StringCollection.zctor();
myAssessments.add("AA000191");
Log.Message(myAssessments.Item(0));
}
For more info,this will help.
Sincerely