Generate Early Bound/Proxy Classes.

Upgrading from v5:
If you have proxy files that were generated using the 'XrmToolkit' method in a version lower than v6, you will need to delete all of those files from the project before trying to generate the new files. If not, XrmToolkit will create/re-generate them using the older format.

Generate Classes

You can generate early bound/proxy classes by using the 'Add Proxy Classes To Project' menu option here:

The possible choices are broken apart by

  • Intersect Entities - Used to store N:N relationship entities
  • Main - All the entities

After selecting which entities you would like to generate classes for, review the 'Options' tab to make sure the settings are how you would like:

  1. XrmToolkit stores both entity and attribute metadata from your linked CRM Organizations. To learn more see our documentation here. You can manually refresh the metadata or the metadata is automatically refreshed when logging onto the organization depending on your settings for item #2 on the "General Tab" shown here. When the metadata is refreshed you can optionally choose to have any proxy classes that are linked in your solution automatically updated with any changes from the metadata.
  2. At the project level, you can choose to use the same settings as the solution, or use custom settings for the project.
  3. XrmToolkit can generate proxy or early bound classes based on either the CrmSvcUtil program included in the CRM SDK or a custom generator used by XrmToolkit. For more information regarding the XrmToolkit generated entities please see the documentation here.
  4. The early bound class names, properties and methods can be named using the following:
    • Display Name - Based on the locale of the person generating the classes
    • Schema Name - Name stored in the database
    • Logical Name - Lowercase name stored in the database
  5. When generating proxy classes, you can choose to use the display names, or the logical names at both the class and property levels. This is a global setting that gets copied to the project level when creating new projects. You can also change this setting at the time that you download any new proxy classes.

    You can also optionally specify a specific naming pattern when generating the proxy class names. The default is to just use either the display name or logical name depending on the setting above. You can specify a prefix or suffix by changing the naming pattern. For example, if you wanted the class name to be [Display Name]Entity then you would specify {0}Entity as the naming pattern.

  6. You can specify the sub-folder that is used as the default for placing all the early bound classes.

After pressing the 'Add To Project' button the metadata will download for each of the entities, and then the classes will be generated. The files will be saved in the specified folder similar to the following:

Manually Refresh Classes

To manually refresh an early bound/proxy class you can select the following option from one or more of the classes in the Visual Studio Solution Explorer:

The entity metadata will be downloaded for each corresponding class and the file regenerated with any updated properties.