2014-05-25 39 views
0

無法從程序集Markweb中加載類型Mark.DAL.CartInitializer運行自定義視圖時出現ASP.NET MVC 5異常

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.TypeLoadException: Could not load type 'Mark.DAL.MarkInitializer' from assembly 'Markweb1'. 

錯誤源:

public ActionResult Index() 
{ 
    return View(db.mark.ToList()); 
} 

回答

0

這通常是被加載一個不正確的裝配的結果。如果您有一個項目引用另一個項目(例如引用「類庫」的'Windows應用程序'類型),並且它們都具有相同的程序集名稱,則會出現此錯誤。重命名引用項目的程序集。或者你可能沒有安裝錯誤中指定的程序集。或者你的DLL依靠其他DLL來完成它的工作,如果你沒有複製或安裝它們,你確實會得到這個錯誤信息。