Use the Sample and Helper Code

[Applies to: Microsoft Dynamics CRM 2011]

Most managed code samples provided in the Microsoft Dynamics CRM SDK that use the organization and discovery web services are using shared helper code to perform common tasks. You might find this helper code useful in applications that you write. Sample helper code can be found in the following folders in the SDK download, and also by following the links provided later in this topic.



When writing an application that uses the Microsoft Dynamics CRM SDK, you typically have to perform the following steps to configure your application’s project.

  1. In the project’s properties, set the target framework to .NET Framework 4.

  2. Add the following .NET references to your project:






  3. Add the required Microsoft Dynamics CRM SDK assembly references. At a minimum, add Microsoft.Crm.Sdk.Proxy and Microsoft.Xrm.Sdk. For a complete list of the assemblies included in the Microsoft Dynamics CRM SDK, see Assemblies Included in the Microsoft Dynamics CRM SDK.

  4. In most cases, you have to install Windows Identity Foundation and add a reference to Microsoft.IdentityModel to your project. You can find this assembly in the global assembly cache or at the following location: Program Files\Reference Assemblies\Microsoft\Windows Identity Foundation\v3.5.

For more information about running the samples included in the Microsoft Dynamics CRM SDK download, see the SDK\SampleCode\Readme.docx. To view a sample application that uses the helper code and includes the required .NET references, see the QuickStart link.

A non-customized early-bound types file that is named MyOrganizationCrmSdkTypes is included in the SDK download in the SampleCode\CS\HelperCode and SampleCode\VB\HelperCode folders to help get you started. However, if your organization has custom or customized entities, you should generate a new early-bound types file. For the purposes of this documentation, the generated classes are included in the global namespace. For more information, see Create Early Bound Entity Classes with the Code Generation Tool (CrmSvcUtil.exe).

See Also

Microsoft Dynamics CRM 2011
Send comments about this topic to Microsoft.
© 2013 Microsoft Corporation. All rights reserved.