- Home /
List<> not showing up in System.Collection.Generic
Hello all! I'm trying to use a list in my project (like I've done many times before) but now for some reason it's not working.
I am putting "using System.Collections.Generic;" at the top, but List seems to be missing (along with several other, like Dictionary).
As a work around, I just Googled the c# List<> source code and pasted it into a List.cs within my project. This causes the error: The namespace 'System.Collections.Generic' already contains a definition for 'List'
Here is a screenshot showing the error, and the contents of my .Generic namesapce (clearly lacking List).
Thanks for your time everybody!
Answer by darthbator · Jun 04, 2013 at 05:51 PM
I never descend into the namespace that way. You should be able to access the namespace without all that, that's what the using directive is for. So since you're using the Generic namespace already you just say List. I believe you would descend into the namespace if you did not have that using directive up there.
I know that the using namespace would make it so I don't have to type it out the long way. That's how I've done it in the past, and until now has worked fine. I did the the long way (in this case) simply to illustrate List<> not showing up in .Generic
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
How to properly create a 2 dimensional array of an object. [C#] 1 Answer
Checking a List 1 Answer
C#, expensive or inexpensive? 1 Answer