The Early Bound Generator tool allows creating strongly type .NET classes representing CDS data model without any command line
Description
Dynamics 365 developers have been used to work with the CrmSvcUtil executable offered in Microsoft.CrmSdk.CoreTools NuGet package. It’s a command-line code generation tool that can be used with the Common Data Service to generate early-bound .NET Framework classes. Those classes represent the entity data model used by a CDS instance.
To put it in simpler terms, this enables developers to have strongly typed .NET classes that represent an entity with all its fields and use it inside Visual Studio.
To have those classes, users must use the tool via the command line. This can get a bit tricky, especially with all parameters that can be added to the CrmSvcUtil.exe command. For example, here is an example from Microsoft’s documentation:
CrmSvcUtil.exe ^
/url:https://myorganization.api.crm.dynamics.com/XRMServices/2011/Organization.svc ^
/out:MyOrganizationSdkTypes.cs ^
/username:you@yourOrg.onmicrosoft.com ^
/password:myp455w0rd ^
/namespace:MyOrg ^
/serviceContextName:MyContext
Mentioned in Microsoft’s documentation, the Early Bound Generator tool provides a graphical interface to generate the early-bound classes. Combined with the easy connection setup from XrmToolBox, this becomes our favorite way to use the CrmSvcUtil command.
The tool has a simple and clear User Interface. On the right pane, users can edit the parameters used by the CrmSvcUtil command. It's also possible to save the parameters into an XML format and to load them afterward, for example for a colleague or to be re-used later.
On the left pane, users can choose to generate the early-bound .NET files for the Entities, the Option Set, and/or and Actions. A click on the button will launch a command prompt and the command line used to create the classes will be displayed on the left pane.
Add new comment