我有一个名为学生在我的linq模型文件夹中的表。当我运行我的应用程序,然后单击学生选项卡时,此错误出现在IE上。我不知道为什么我看到这一点。为什么我在MVC中使用LINQ时收到此错误?
编译器错误消息:
CS0012: The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
源错误:
Line 27:
Line 28:
Line 29: public class _Page_Views_Student_Index_cshtml : System.Web.Mvc.WebViewPage> { Line 30:
Line 31: #line hidden
源文件:
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\682ba75a\2833b27b\App_Web_index.cshtml.b4fd288c.t7qdtf0f.0.cs Line: 29
错误消息告诉你该怎么做。 – Jon 2012-07-13 14:54:43
必须将来自错误消息的“引用”添加到Web项目中。 – 2012-07-13 14:55:42