2014-06-25 19 views
0

創建控制器我有對我的asp.net mvc一個sintak controller問題,得到錯誤,而在Asp.net的mvc與TDK

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(); 
     } 
    } 
} 

而且有錯誤:

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

回答

2

這很可能是因爲您缺少對豐田的參考。右鍵單擊References並添加提到的參考。

0

假設Toyota參考你從你自己的class Library或DLL引用。

  1. 如果該項目/ DLL有任何問題。推薦的項目不會在這個解決方案中正確加載dll。所以你可能會得到一個錯誤(如你所知)。

  2. 根據@Khaltazar答案,您可能會錯過參考添加。您已在控制器中將NameSpace稱爲using Toyota.Common.Web.Platform;。但請將reference dll加入您的current project references

  3. 最後Clean的解決方案和Build/ReBuild

  4. 如果referred dll is being process與其他任何(可能是Locked)停止過程。