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# 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?

using System.Web.Mvc;

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


1 Answer

Steven Parker
Steven Parker
229,608 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