ASP.net页面在import语句中获取错误,但我有参考的地方吗?
发布时间:2020-12-15 19:41:35 所属栏目:asp.Net 来源:网络整理
导读:任何想法为什么我得到下面的错误在我的MVC2项目,即使通过在项目本身我绝对有一个引用“system.Web.Entity”? Compiler Error Message: CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an a
任何想法为什么我得到下面的错误在我的MVC2项目,即使通过在项目本身我绝对有一个引用“system.Web.Entity”?
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:WINDOWSMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Filesroot6ec16fd2a2147d7cApp_Web_index.aspx.1b64bdf1.ajruf7pv.0.cs Line: 166 解决方法
如
miensol建议,尝试把它放在你的Web.config文件中:
<compilation debug="true" targetFramework="4.0"> <assemblies> <add assembly="System.Data.Entity,PublicKeyToken=b77a5c561934e089" /> </assemblies> </compilation> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 将列表绑定到asp.net 3.5中的列表视图
- asp.net-mvc – 重定向页面的TempData?
- asp.net – TransactionScope是否需要DTC服务?
- asp.net-web-api – 设计REST ful ODATA API,结果集为空时如
- 我可以在ASP.NET中使用C#获取时间参数的本地化缩写吗?
- asp.net-mvc – 定义脚手架. (关于动态数据和ASP.NET MVC)
- asp.net-mvc – 通知面板类似于stackoverflow的
- asp.net – 如何使用queryString将值从一个asp页面传递到另
- asp.net-mvc – ASP.NET不向客户端发送上传进度
- asp.net – 注册.NET 4.5 IIS 10 Windows 10
推荐文章
站长推荐
热点阅读