Announcements
I've got an MVC.NET solution that calls the Dataverse API and I'm seeing a significant performance degradation when using CrmServiceClient and AuthType=OAuth compared with the (soon to be deprecated) WS-Trust connection (AuthType=Office365)
This is the code used for creating the CrmServiceClient connection (AuthType=OAuth)
var conn = new CrmServiceClient(connectionString);
var service = (IOrganizationService) conn.OrganizationWebProxyClient ?? conn.OrganizationServiceProxy;
and this is the code used for creating WS-Trust connection (AuthType=Office365)
var target = CrmConnection.Parse(connectionString);
target.ServiceConfigurationInstanceMode = ServiceConfigurationInstanceMode.PerName;
var service = (OrganizationService) CrmConfigurationManager.CreateService(target, "DataverseServiceName");
has anyone experienced the same issue?
In our case the issue was that we were using an old version of the CrmSdk, using the latest version (9.0.2.42) solved our problem
We also have issues with impersonation when setting the caller id (docs.microsoft.com/.../microsoft.xrm.tooling.connector.crmserviceclient.callerid, if you are running several threads and initiating multiple connections with different callerids, we found that it's not thread safe and some calls to impersonate one user might get mixed up by another user even if:
- disablecrossthreadsafeties is set to false (docs.microsoft.com/.../microsoft.xrm.tooling.connector.crmserviceclient.disablecrossthreadsafeties
- RequireNewInstance is set to true (docs.microsoft.com/.../use-connection-strings-xrm-tooling-connect
We ended up having to cache each IOrganizationService per callerid to prevent it
Hello,
We too have started to get that performance degradation when we start using AuthType=OAuth, we are also using CrmServiceClient to connect.
Have you found any solution? The truth is that it is penalizing us a lot.
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156