Hi
Connections using CrmServiceClient sometimes result in null values.
It happens intermittently if you use it continuously, and most of the time, it seems that the connection is not made once an hour.
<add name="ConnectionString"
connectionString="AuthType=ClientSecret; url={myorg}.crm5.dynamics.com; clientid={clientid}; clientsecret={mysecret};"/>
private static IOrganizationService service;
private string _conStr = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
public IOrganizationService CreateOrganizationWebProxyClient()
{
CrmServiceClient client;
client = new CrmServiceClient(_conStr);
service = (IOrganizationService)client.OrganizationWebProxyClient != null ? (IOrganizationService)client.OrganizationWebProxyClient : (IOrganizationService)client.OrganizationServiceProxy;
return service;
}
The code used is as above.
Sometimes I want to know why the connection doesn't work.