Can't access Microsoft.Xrm namespace

Konrad Viltersten picture Konrad Viltersten · Sep 11, 2012 · Viewed 20.6k times · Source

I've downloaded CRM Dynamics SDK and keep it in a local directory. In my code, I'm using EntityCollection (amongst other classes related to Xrm namespace), which means that I need to add using Microsoft.Xrm.Sdk;.

The problem is that during compilation I get errors saying that:

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

So, I double check that the reference is made and, very accurately, I see that microsoft.xrm.sdk indeed is in my list. Just to be sure, I've removed it and added it again by pointing to the DLL with the same name. To no avail, though... The flabbergasting thing is that my colleague uses the same code and it compiles on his machine (the only difference being that he's on Win 7 and I'm on Win 8).

How do we kill this problem?

Answer

Jason Lattimer picture Jason Lattimer · Sep 11, 2012

Double check in your project settings to see which Target Framework you are using. If it is .NET Framework 4 Client Profile try changing it to .NET Framework 4.