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# ASP.NET MVC Basics Controllers Creating a Controller

Akram Shenoda
Akram Shenoda
1,392 Points

The type or namespace name `system' could not be found?

im trying to create class name VideoGamecontroller by it didnt work and gives me this error "The type or namespace name `system' could not be found", whats did i missed?

VideoGamesController.cs
using System.Web.Mvc;

namespace Treehouse.Controllers
{
     class VideoGameController : system.web.mvc.controller
    {

    }
}

1 Answer

Steven Parker
Steven Parker
220,634 Points

It looks like you have a few issues:

  • C# is case-sensitive, something defined using upper case will not be recognized if spelled in lower case
  • you wrote "VideoGameController", but the challenge asked you to create "VideoGamesController" (with an "s")
  • you forgot to give your class the public access specifier
  • since you have the using directive, you can abbreviate System.Web.Mvc.Controller to simply Controller