ASP.net页面获得进口语句错误,但我有到位的参考? [英] ASP.net page gets error on import statement, but I do have the reference in place?
本文介绍了ASP.net页面获得进口语句错误,但我有到位的参考?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为什么我在项目本身获得在我的MVC2项目下面的错误,甚至通过我肯定有提到system.Web.Entity任何想法?
编译器错误信息:CS0234:(是否缺少程序集引用)类型或命名空间名称'实体'不会在命名空间System.Data这存在源错误:1号线:其中,%@页面语言=C#继承=System.Web.Mvc.ViewPage<名单,LT;节点>>中%GT;
2号线:LT;%@导入命名空间=TopologyDAL%GT;
3号线:其中,%@导入命名空间=System.Data.Entity的%>
感谢
编辑 - 通过,如果我拿出3号线的方式,然后我得到的错误:
编译错误
说明:该请求提供服务所需资源的编译过程中出现错误。请检查下列特定错误详细信息并适当地修改源$ C $ C。编译器错误信息:CS0012:类型'System.Data.Objects.DataClasses.EntityObject'在未引用的程序集定义。您必须添加一个引用到组装'System.Data.Entity的,版本= 4.0.0.0,文化=中性公钥= b77a5c561934e089'。源错误:164线:
165线:[System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]
166线:公共类views_node_index_aspx:System.Web.Mvc.ViewPage<名单,LT;节点>>中System.Web.SessionState.IRequiresSessionState,System.Web.IHttpHandler {
167线:
168线:私有静态布尔@__initialized;
源文件:C:\\ WINDOWS \\ Microsoft.NET \\框架\\ v4.0.30319 \\临时ASP.NET文件\\ ROOT \\ 6ec16fd2 \\ a2147d7c \\ App_Web_index.aspx.1b64bdf1.ajruf7pv.0.cs线:166
解决方案
miensol 建议,尽量把这个在你的的Web.config
文件:
<编译调试=真targetFramework =4.0>
<&集会GT;
<添加组件=System.Data.Entity的,版本= 4.0.0.0,文化=中性公钥= b77a5c561934e089/>
< /组件>
< /编译>
Any ideas why I am getting the below error in my MVC2 project, even through in the project itself I definitely have a reference to "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" %>
thanks
EDIT - By the way if I take out Line 3 then I get the error:
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
解决方案
As miensol suggested, try putting this in your Web.config
file:
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
这篇关于ASP.net页面获得进口语句错误,但我有到位的参考?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文