Using CrmSvcUtil.exe
A Magic is just a stick and brain that’s all.
Using the magic tool CrmSvcUtil.exe which can be found in Bin folder of CRM SDK (download). This is very easy way to create CRM organisation entity proxy class which is used in the project.
- If you are using On-Premise CRM server type the below command with correct values
- Change the current directory in the command prompt window to the SDK\Bin directory
- Open the command prompt (Run->cmd).
- Go to the extracted folder and check if the tool(CrmSvcUtil.exe) exist in SDK\Bin\ folder
- Download the CRM SDK and extract the .zip file in a local directory.
- For On-Premise CRM server use the following command with correct values CrmSvcUtil.exe /url:http://<serverName>/<organizationName>/XRMServices/2011/Organization.svc /out:<outputFilename>.cs /username:<username> /password:<password> /domain:<domainName> /namespace:<outputNamespace> /serviceContextName:<serviceContextName>
- For Online CRM server use the following command with appropriate values. CrmSvcUtil.exe /url:https://<organizationUrlName>.api.crm.dynamics.com/XRMServices/2011/Organization.svc /out:<outputFilename>.cs /username:<username> /password:<password> /namespace:<outputNamespace> /serviceContextName:<serviceContextName>
- Press enter after providing all values. Hope you understand the what values to specify, let me know if any concern.
- Now go to the same SDK\Bin directory and you will find a .cs file with name <outputFilename> you have specified before.
- Copy the .cs file and place in your visual studio project to start using the data model.
Now we are ready to use early bound types. Check how to write codes using early bound class.