任何想法,爲什麼我在我的MVC2項目中得到下面的錯誤,即使通過項目本身,我肯定有一個「system.Web.Entity」的引用?ASP.net頁面在導入語句中出錯,但我確實有參考嗎?
Compiler Error Message: CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
Source Error:
Line 1: <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<List<Node>>" %>
Line 2: <%@ Import Namespace="TopologyDAL" %>
Line 3: <%@ Import Namespace="System.Data.Entity" %>
感謝
編輯 - 通過,如果我拿出3號線的方式,然後我得到的錯誤:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0012: 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'.
Source Error:
Line 164:
Line 165: [System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]
Line 166: public class views_node_index_aspx : System.Web.Mvc.ViewPage<List<Node>>, System.Web.SessionState.IRequiresSessionState, System.Web.IHttpHandler {
Line 167:
Line 168: private static bool @__initialized;
Source File: c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\6ec16fd2\a2147d7c\App_Web_index.aspx.1b64bdf1.ajruf7pv.0.cs Line: 166
您是否在Web.config中引用了此程序集System.Data.Entity? (部分) –
miensol
2010-05-27 06:56:55
否 - 我只是將它添加到項目的引用部分 - 這是asp.net的問題嗎? – Greg 2010-05-27 07:00:35