Saturday, 21 May 2016

Generating CRM proxy class for early binding

CrmSvcUtil.exe is a command-line code generation tool in that generates early-bound 

Microsoft Dynamics CRM 2015 provides an extension to the CrmSvcUtil.exe command-line tool, called theMicrosoft.Xrm.Client.CodeGeneration extension, which you can use to generate the data context and data transfer object classes for your Microsoft Dynamics CRM organization.

Download the SDK and Microsoft.Xrm.Client.CodeGeneration dll should be in bin folder

Integrated Authentication Example

  1. CrmSvcUtil.exe /codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization, Microsoft.Xrm.Client.CodeGeneration"
  2. /url:http://crm/Contoso/XRMServices/2011/Organization.svc
  3. /out:"Xrm.cs"
  4. /namespace:Xrm
  5. /servicecontextname:XrmServiceContext
  6. /servicecontextprefix:Xrm

Active Directory Authentication  Example

  1. CrmSvcUtil.exe /codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization, Microsoft.Xrm.Client.CodeGeneration"
  2. /url:http://crm/Contoso/XRMServices/2011/Organization.svc
  3. /domain:contoso
  4. /username:administrator
  5. /password:pass@word1
  6. /out:"Xrm.cs"
  7. /namespace:Xrm
  8. /servicecontextname:XrmServiceContext
  9. /servicecontextprefix:Xrm

Live ID (CRM Online) Authentication

  1. /url:http://myorg.api.crm.dynamics.com/XRMServices/2011/Organization.svc
  2. /out:"Xrm.cs"
  3. /username:user@hotmail.com
  4. /password:pass@word1
  5. /deviceid:mydeviceid
  6. /devicepassword:mydevicepassword
  7. /namespace:Xrm
  8. /servicecontextname:XrmServiceContext
  9. /servicecontextprefix:Xrm

Claims Authentication (IFD, Active Directory) 

  1. CrmSvcUtil.exe /codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization, Microsoft.Xrm.Client.CodeGeneration"
  2. /url:https://crm:555/Contoso/XRMServices/2011/Organization.svc
  3. /username:administrator
  4. /password:pass@word1
  5. /out:"Xrm.cs"
  6. /namespace:Xrm
  7. /servicecontextname:XrmServiceContext
  8. /servicecontextprefix:Xrm