The CrmServiceClient class allows you to connect easily to the Common Data Service and execute the API operations offered by the platform. Depending on your particular implementation, you may need to change the connection timeout. This article explains how to apply a custom timeout to a CrmServiceClient intance.
As I covered in my previous article, the CrmServiceClient class has two important properies: OrganizationServiceProxy and OrganizationWebProxyClient. They may let you change the connection timeout that you are looking for. However, this is not the best practice for new implementations. You should use the CrmServiceClient static property MaxConnectionTimeout:

Previously to the deprecation of OrganizationServiceProxy, you may have used the following option:

The other possible alternative to the CrmServiceClient.MaxConnectionTimeout could be the OrganizationWebProxyClient reference, but I would still not recommend to use this option:

You can download and test this code from my GitHub repository:
https://github.com/rtebar/Dynamics-Utils/blob/master/Dynamics.Utils/Dynamics.Utils.Tests/ProxyTimeout.cs
Notes: At the time of writing this article, Iām using the package Microsoft.CrmSdk.XrmTooling.CoreAssembly 9.1.0.38 and Iām connecting to an environment whose version is 9.1.0.14744 with 2020 release wave 1 enabled
Hi Ramon,
OrganizationServiceProxy is deprecated and will be removed soon. You shouldn’t have to access this property (or even OrganizationWebProxyClient) to set the Timeout
Juste use this code : CrmServiceClient.MaxConnectionTimeout = new TimeSpan(0,0,15);
Thanks you very much Tanguy! Oh, I completely missed that one. It makes sense to be honest, the fact of having OrganizationServiceProxy and OrganizationWebProxyClient was an overhead. Is there any official documentation about this deprecation?
Yes: https://docs.microsoft.com/en-us/power-platform/important-changes-coming#deprecation-of-office365-authentication-type-and-organizationserviceproxy-class-for-connecting-to-common-data-service
Haha, you were quicker! Thanks again Tanguy! I’ll update my articles to inform the community about this important change.
Ok, I found it!
This is the official documentation regarding this deprecation: https://docs.microsoft.com/en-us/power-platform/important-changes-coming#deprecation-of-office365-authentication-type-and-organizationserviceproxy-class-for-connecting-to-common-data-service
Hi Ramon,
You shouldn’t have to user OrganizationServiceProxy (it’s deprecated and will be removed soon) or even OrganizationWebProxyClient to set Timeout
Just use the snippet below:
CrmServiceClient.MaxConnectionTimeout = new TimeSpan(0,0,15);