Saturday, March 19, 2011

The type or namespace name 'xxxx' does not exist in the namespace 'yyyy' (are you missing an assembly reference?)

Problem:
Error    1          The type or namespace name 'xxxx' does not exist in the namespace 'yyyy' (are you missing an assembly reference?)
Screenshot:

My environment: Visual Studio 2010, .Net 4.0.   Two projects involved, 1 is a dll, other is a console app.

You know your reference is correct, but you still get that reference error.  Your using clause fails, too.
Screenshot:
 

Solution:
In this case, my console app had the Target Framework in the project properties set to .NET Framework 4 Client Profile, the dll project had it set to .NET Framework 4.  I changed the console app to use .NET Framework 4, and everything built fine.

Console App Project properties before:

Console App Project properties after:


7 comments:

  1. wow!
    I found this today after having the exact same issue.

    Thanks for the detailed post it sure saved me some time.

    I'll subcribe to your feed and I love your site title too!

    ReplyDelete
  2. Thanks dude, any idea wuzup with the client profile?

    ReplyDelete
  3. Thanks Dude wish I had seen this three hours ago... :0

    ReplyDelete
  4. Great, your solution worked perfect! Thanks

    ReplyDelete
  5. thanks man, made my day!

    ReplyDelete