Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
14,855 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
14,855 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! πŸŽ‰πŸŽŠ