类型或命名空间“MyNamespace”不存在等 [英] The type or namespace 'MyNamespace' does not exist etc
问题描述
我有通常的类型或命名空间名称不存在错误,除了我已经引用了程序集,使用语句不显示不正确,我引用的类是public。事实上,我在不同的解决方案中引用和使用相同的程序集来做同样的事情,它工作正常。
这是VS2010顺便说一下。
如果有人感兴趣,我已经找到了这个问题的答案。
在我的主要应用程序中,我定位.NET Framework 4客户端配置文件,在一个引用的程序集中,我定义了完整的.net框架。虽然intellisense和Visual Studio本身没有报告问题,编译器抛出一个错误。不是与目标框架思想相关的错误,只是一个类型或命名空间不存在错误与我的命名空间相关,而不是在框架的客户端配置文件版本中缺少的错误。
Ed
I have the usual type or namespace name does not exist error, except that I have referenced the assembly, the using statement does not show as incorrect and the classes I am referencing are public. In fact, I reference and using the same assembly in a different solution to do the same thing and it works fine.
This is VS2010 by the way.
Any ideas anyone?
Ed
I have discovered the answer to this problem if anyone else is interested.
In my main application I target the .NET Framework 4 Client Profile, but in one of the referenced assemblies I target the full .net framework. Whilst the intellisense and Visual Studio itself don't report a problem, the compiler throws an error. Not an error relating to the target framework mind, just a "The type or namespace does not exist" error relating to my namespace rather than the one that is missing in the client profile version of the framework.
Ed
这篇关于类型或命名空间“MyNamespace”不存在等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!