Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# C# Collections Arrays Multidimensional Arrays

C# The type or namespace 'Cell' could not be found.

when trying to use Cell[,] to initialize a multidimensional array I get the error in the csharp repl: The type or namespace 'Cell' could not be found. I also get the same message when trying to compile code in Visual Studio. Is there an import or something needed?

3 Answers

Daniel Tkach
Daniel Tkach
7,608 Points

You have to first define that "Cell" class, it's not something defined in .net already. Enter in the repl what the Cell class should be, maybe something like: public class Cell { public string Data { get; set; } }

or anything else you want that cell to contain.

Thank heaps!

Kevin Gates
Kevin Gates
15,052 Points

Jeremy McLain : is this something you can update in the teacher's notes? Especially since this lesson starts a new workspace?

Kevin Gates
Kevin Gates
15,052 Points

Jeremy McLain : is this something you can update in the teacher's notes? Especially since this lesson starts a new workspace?

Step to Type in the console before starting this video: (See video "Jagged Arrays" Starting at 0:40)

βœ”Step 1 : (Type csharp in console)

treehouse:~/workspace$ csharp
Mono C# Shell, type "help;" for help

βœ”Step 2: (Create Cell class with getter and setter)

Enter statements below.
csharp> class Cell
> {
> public string Contents { get; set; }
> }

I hope this helps! πŸ±β€πŸ

Keep Coding Future .Net/C# Developers! πŸŽ‰πŸŽŠ