How To Fix:Error 39 The type or namespace name ‘Contracts’ does not exist in the namespace ‘XXX’ (are you missing an assembly reference?)

So….Just got done mentally disintegrating my computer and various items around it. This lovely error kept appearing to tell me ABSOLUTELY NOTHING.

I checked my references, of course they were included. It’s how I had intellisense, and every other feature that leads me to believe everything is A OK. That is, until you actually compile. You then get the awesomely descriptive error above.

Oh, It appears descriptive right? You say, oh, I must have done something wrong and somehow removed the assembly reference. Let me check it? Nope, it’s there.

Well, it turns out the answer is simple and the stupid compiler could have added one more suggestion. Here is how I would write it.

The type or namespace name ‘Contracts’ does not exist in the namespace ‘XXX’ (are you missing an assembly reference? Are the assemblies built using the same .NET Runtime Profile?)

Yup! One assembly was using the .NET 4.0 CLIENT profile and the other the .NET 4 Full profile. Awesome huh!!!

So, if you come across this with one eye bleeding because you stabbed yourself and missing hair, now you know the simple resolution.

image

 

Happy Coding!

0 Replies to “How To Fix:Error 39 The type or namespace name ‘Contracts’ does not exist in the namespace ‘XXX’ (are you missing an assembly reference?)”

Leave a Reply

Your email address will not be published. Required fields are marked *