[Mono-dev] System.Collections not found on my system
monoman at gmail.com
Thu Mar 22 11:47:31 UTC 2012
System.Collections is a namespace with most classes belonging to it
residing in the System.dll assembly.
You need to reference the assembly (this one in particular is automatically
referenced by MonoDevelop on new projects), and then in the source you need
to bring the namespace in scope with the using clause or reference the
class by it's fully qualified name:
ArrayList list = new ArrayList();
System.Collections.ArrayList list = new System.Collections.ArrayList();
Namespaces in .NET are akin to packages in Java, but are more flexible. It
baffles many programmers coming from languages with a single, global, name
space, or those that doesn't yet know that one must lookup documentation
specific for each class to find in which namespace it resides in logical
terms (to add the proper 'using' clause or full qualification) AND in which
assembly (library/executable) it's implementation physically resides to
tell the compiler to reference it (there's a dialog devoted to manage the
list of such references for each project).
This is a very common question... :)
Hope it helps,
Rafael "Monoman" Teixeira
"The most exciting phrase to hear in science, the one that heralds new
discoveries, is not 'Eureka!' (I found it!) but 'That's funny ...'"
US science fiction novelist & scholar (1920 - 1992)
On Thu, Mar 22, 2012 at 7:07 AM, Stephen2 <stephen.t.pittman at gmail.com>wrote:
> Hi all, newbie here! Using Archlinux, mono-2.10.8-1, monodevelop 126.96.36.199-2
> I don't seem to have System.Collections available to me!
> find /usr/lib/mono | grep Collection
> returns nothing :(
> Can anyone help me get this going? I've googled for a long while.
> View this message in context:
> Sent from the Mono - Dev mailing list archive at Nabble.com.
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-devel-list