The type or namespace 'MyNamespace' does not exist etc

谁说胖子不能爱 提交于 2019-12-22 08:44:49

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/3861882/the-type-or-namespace-mynamespace-does-not-exist-etc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!