I'm trying to connect to DevelpmentService of MS CRM from custom plugin and thus I'm not able to use app.config generated when I added WebReference to solution.
Here is the working code:
var id = new EntityInstanceId { Id = new Guid("682f3258-48ff-e211-857a-2c27d745b005") }; var client = new DeploymentServiceClient("CustomBinding_IDeploymentService"); var organization = (Organization)client.Retrieve(DeploymentEntityType.Organization, id); And corresponding part of the app.config:
<client> <endpoint address="http://server/XRMDeployment/2011/Deployment.svc" binding="customBinding" bindingConfiguration="CustomBinding_IDeploymentService" contract="DeploymentService.IDeploymentService" name="CustomBinding_IDeploymentService"> <identity> <userPrincipalName value="DOMAIN\DYNAMICS_CRM" /> </identity> </endpoint> ... </client> Is it possible to transform code in the way when configuration file will not be needed. How?