In this blog we will learn, how to use CrmSvcUtil tool in Visual Studio. Here are the steps.
- In Visual Studio, create a new “Class Library” project as shown in the following screen shot
- Delete the class file “class1.cs” created by the Visual Studio.
- Add the following files to the project from SDK\Bin folder of CRM SDK.
<?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="url" value="https://cdc.crm5.dynamics.com/XRMServices/2011/Organization.svc"/> <add key="o" value="CrmProxy.cs"/> <add key="u" value="email@example.com"/> <add key="p" value="password"/> <add key="servicecontextname" value="XrmContext"/> </appSettings> </configuration>
- You can add, remove and edit keys in CrmSvcUtil.exe.config to pass parameters to code generator tool.
- Try accessing the CRM through the browser before debugging, if you are working with CRM Online.
- You can add this project to any of your crm solution. Change the "Working directory" of the project to generate the CrmProxy file in a desired folder.