在MVC4视图中使用Model时出现程序集错误

时间:2013-04-01 09:57:10

标签: razor asp.net-mvc-4

@using System.Data.Entity;

@model SurveyBuilderViewModel.SurveyViewModel



@{
    ViewBag.Title = "addQuestions";
    Layout = "~/Views/Shared/_Layout.cshtml";

}

@Html.TextBoxFor(m => Model.QuestionModel.QuestionStatement);

它给了我错误

The type 'System.Data.Objects.DataClasses.EntityObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

我如何解决它以及我在哪里做错了...... ????

1 个答案:

答案 0 :(得分:0)

我认为问题很明显

  

您必须添加对程序集'System.Data.Entity的引用,   Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'

在项目中引用该DLL。