4

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

Ed Bishop
  • 770
  • 8
  • 19

1 Answers1

10

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

Ed Bishop
  • 770
  • 8
  • 19
  • This exact same thing happened to me and I lost time on it so watch out. You wouldn't think that a reference to the .NET Framework 4 Client Profile would make a difference to your console app but it does and it's not obvious why the type of namespace error crops up. It really does give you misleading info with respect to this problem. – Daver Apr 04 '11 at 23:51