Stan Stan - 1 year ago 137 Question

Create instance of ISet(of String)

I am struggling. Got properties that are of type ISet(of String) and I need to assign them with value.


throws empty link error since it is not instantiated, been trying to create an instance, assign value and pass with set(), but


throws empty link. Neither this solution Visual Basic: dynamically create objects using a string as the name works, I ve output the list and ISet is simply not there.

I've been trying to solve this for a while now.

Answer Source

Interfaces don't fully define objects. They only define one part of an object, and therefore you don't have enough information from the ISet(Of String) interface on it's own to create an instance.

What you need to do is find a type that implements the interface, and create one of those... HashSet(Of String) and SortedSet(Of String) would both work.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download