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

0 views
Skip to first unread message

Stephen2

unread,
Mar 22, 2012, 6:07:18 AM3/22/12
to mono-de...@lists.ximian.com
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-de...@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Rafael Teixeira

unread,
Mar 22, 2012, 7:47:31 AM3/22/12
to Stephen2, mono-de...@lists.ximian.com
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)

Stephen2

unread,
Mar 23, 2012, 3:55:25 AM3/23/12
to mono-de...@lists.ximian.com
Thank you very much! The detailed explanation was really clear and perfect!


--
View this message in context: http://mono.1490590.n4.nabble.com/System-Collections-not-found-on-my-system-tp4495070p4498081.html

Reply all
Reply to author
Forward
0 new messages