Saturday 31 December 2011

CRM Online can't find Microsoft.Xrm.Client.dll

Hi all,

Today I was writing (and I am still) a Plug-in for CRM online 2011 and counter a error as:
Could not load file or assembly 'Microsoft.Xrm.Client, Version=5.0.9688.1154, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
It happens because in my project I reference to Microsoft.Xrm.Client.dll and in the CRM online server this DLL is not installed.

I think this client dll is not intended to be used in server environment and therefore is not installed in CRM server.

I founded the generated code from crmsvcutil actually required the client dll if you include following parameter in your generation command .
/codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization, Microsoft.Xrm.Client.CodeGeneration"
I re-generated the code file from crmsvcutil without the parameter and reload the project with an updated code file (Xrm.cs), recompile the project and it works :)

By the way, Happy 2012 :)

7 comments:

  1. Hej. I have a weird problem. I hav the microsoft.xrm.client.dll. If I check version number in explorer (right click->properties) I see the version number ends with .1155, but when i reference the dll in visual studio, I see the version of the dll, inside VS2010, end with .1154

    Do u know what the problem is?

    ReplyDelete
  2. Thanks a lot pal .... you are a genius :)

    Regards,
    Namrata Mathur

    ReplyDelete
  3. Not working.
    I am using this code after executing the plugin

    To get all the contacts I want to create a new object.
    var connection = CrmConnection.Parse("ServiceUri=myconnection");
    var service = new OrganizationService(connection);
    var context1 = new CrmOrganizationServiceContext(connection);

    var xrm = new XrmServiceContext(context1);

    This shows the same exception.

    How to solve this.

    ReplyDelete
  4. Hi there. I found your web site by the use of Google even as searching for a similar matter, your web site came up. It appears to be good. I’ve bookmarked it in my google bookmarks to come back then.
    ios game development

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete