user3675026
user3675026

Reputation: 11

Getting error while creating controller in Asp.net Mvc with tdk

I have a problem with my sintak controller on asp.net mvc,

 using Toyota.Common.Web.Platform;
 using FAMS.Models;

 namespace FAMS.Controllers 
 {
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult About()
        {
            return View();
        }
    }
 }

And have error:

Error 1 The type or namespace name 'Toyota' could not be found (are you missing a using directive or an assembly reference?) e:\ExampleApplication\ExampleApplication\Views\Shared_Layout.cshtml 1 8 ExampleApplication

Upvotes: 0

Views: 105

Answers (2)

Rajeshkumar Kandhasamy
Rajeshkumar Kandhasamy

Reputation: 6461

Assuming Toyota reference which is you referred from your own class Library or dll.

  1. If that project/dll is having any issue. referred project will not load the dll properly in this solution. So you may get an error (as you got).

  2. As per the @Khaltazar answer you may missed the reference to add. You have referred the NameSpace as using Toyota.Common.Web.Platform; in your controller. But add the reference dll in to your current project references.

  3. Finally Clean the solution and Build / ReBuild.

  4. Stop the process if the referred dll is being process with any other (It may be Locked).

Upvotes: 0

Khaltazar
Khaltazar

Reputation: 296

It's most likely because you are missing a reference to Toyota. Right click on References and add that reference mentioned.

Upvotes: 2

Related Questions