[Mono-dev] System.Collections not found on my system

Rafael Teixeira monoman at gmail.com
Thu Mar 22 11:47:31 UTC 2012


Hi Stephen,

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:
-----------
using System.Collections

...

   ArrayList list = new ArrayList();

-----------

or

-----------

   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 ...'"
Isaac Asimov
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 2.8.6.5-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:
> http://mono.1490590.n4.nabble.com/System-Collections-not-found-on-my-system-tp4495070p4495070.html
> Sent from the Mono - Dev mailing list archive at Nabble.com.
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20120322/72c8b486/attachment.html>


More information about the Mono-devel-list mailing list