When developing against a customised instance of CRM 2011, often you will want to do so against a strongly typed instance of the current CRM 2011 organisation.
To do this, you need to use the crmsvcutil.exe application which will create the a strongly-typed version of the CRM organisation as a separate set of classes.
You’ll find the application in the CRM SDK bin subfolder.
There are a number of options you can see by running
crmsvcutil /?
from a command prompt.
This is what you’ll see:
To find your organisation Url, go open up your CRM 2011 organisation, and navigate to the Settings -> Customisations -> Developer Resources area as follows:
Once you’re there, the organisation url can be found by selecting the Organisation Service, as shown in the screenshot below:
To create the proxy class, enter this into a command prompt from the SDK bin folder:
crmsvcutil /url:http://localhost/[ORGANISATION-SHORT-NAME]/XRMServices/2011/Organization.svc /namespace:MyNameSpace.Here /out:"c:\Projects\MyProject\[ORGANISATION-NAME].cs" |
Your machine will whir for a bit and then you’ll see the new (5Mb+!) C# file that has been generated.
To use the file, create a new Visual Studio project, add references to the Microsoft.Crm.Sdk.Proxy.dll and Microsoft.Xrm.Sdk.dll (found in the SDK bin folder) and then you can start developing against the strongly typed CRM object model.