ASP.net页面在import语句中获取错误,但我有参考的地方吗?
发布时间:2020-05-27 16:52:42 所属栏目: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 ass
|
任何想法为什么我得到下面的错误在我的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 – 如何使用TLS电子邮件与web.config
- asp.net 使用驻留在页面中的Cache缓存常用可定时更新的数据
- asp.net – 我可以在ASPX页面中使用扩展方法内联吗?
- asp.net – 为动态生成的孙子控件添加PostBackTriggers和As
- 如何在ASP.NET MVC中使用JQuery调用控制器操作
- 取消ASP.NET中的默认提交按钮
- asp.net – 如何在MVC Razor中处理null子实体
- asp.net – 如何获取Page.ClientScript.RegisterClientScri
- asp.net – IIS URL重写 – 具有多个域
- 模型绑定 – WebApi2:自定义参数绑定以绑定部分参数
推荐文章
站长推荐
- asp.net – 如何使用resxresourcewriter写入所有
- asp.net – 在.css文件中引用应用程序相对虚拟路
- asp.net-mvc – Ninject.Extensions.Logging.nlo
- ASP.NET WebMethod返回包含在引号中的JSON
- ASP.NET MVC中引用JavaScript的正确方法?
- asp.net – 使用Typescript时Visual Studio 2015
- asp.net-mvc – ASP.NET MVC模型在编辑器模板中绑
- asp.net – 如果缓存破坏程序与内容不匹配,防止捆
- asp.net – 在日期字段中插入空值?
- asp.net-core – 从appsettings.json获取Connect
热点阅读
