找不到类型或名称空间名称"NAMESPACE"(您是否缺少using指令或程序集引用?) [英] The type or namespace name 'NAMESPACE' could not be found (are you missing a using directive or an assembly reference?)

查看:372
本文介绍了找不到类型或名称空间名称"NAMESPACE"(您是否缺少using指令或程序集引用?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在构建项目时,我一直收到此错误.该项目从1.1转换为2.0.所涉及的NAMESPACE存在并将其添加到解决方案中.报告错误的单元是位于App_Code文件夹中的Global.asax.cs.同样,同一文件夹中的另外2个单元报告有关相同NAMESPACE的相同错误以及另一个错误.再次将程序集添加为对项目的引用.

谢谢

Adrian

I keep getting this error when I build my project. The project was converted to 2.0 from 1.1. The NAMESPACE in question exists and is added to the solution. The unit reporting the error is Global.asax.cs sitting an App_Code folder. Also another 2 units in the same folder are reporting same error about same NAMESPACE plus another one. Again the assemblies are added as references to the project.

Thanks

Adrian

推荐答案

对于它的价值,我记得当被引用程序集的目标框架是".NET Framework 4"时,我看到了相同的症状,但是我从目标为".NET Framework 4 客户端配置文件"的类库中引用它.一旦更改了类库的目标框架以使其与所引用程序集的目标框架相匹配,问题就消失了.
For what it''s worth, I remember seeing the same symptoms when the target framework of the referenced assembly was ".NET Framework 4", but I was referencing it from a class library with the target of ".NET Framework 4 Client Profile". Once I changed the target framework of my class library to match that of the referenced assembly, the problem disappeared.


看看中的 Note 部分href ="http://msdn.microsoft.com/zh-cn/library/wkze6zky%28VS.71%29.aspx">此页面 [
Take a look at the Note part in this page[^] from MSDN.

Could this be the cause of your problem?


这篇关于找不到类型或名称空间名称"NAMESPACE"(您是否缺少using指令或程序集引用?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆