The Developer Extensions for Microsoft Dynamics CRM are extremely helpful tools for developing custom code for CRM. They provide a simplified way to connect to the CRM Services with the ability to be configured and extended.
One ‘gotcha’ when using the CrmConfigurationManager class to connect to CRM is that the default configuration includes caching of the organization service. A colleague of mine was running into an issue where the organization service wasn’t recognizing his newly created relationship when developing a query, so he had the need to disable caching.
To do this, update the App.config with the following XML:
Note that this requires the microsoft.xrm.client section to be declared in the App.config as well. The full App.config should look something like this:
The examples above are covered in the following MSDN article http://msdn.microsoft.com/en-us/library/gg695805.aspx