I have a program to insert rows in Dynamics 365 instance. The program runs well when i use a console app, but with the same code runs in a Windows Service program, when insert a row, show this error:
Error: InnerException = {Microsoft.IdentityModel.Clients.ActiveDirectory.dll":null} HResult: -2146233088
Any help to resolve this problem?
Hello,
Seems that you use not the pure CrmServiceClient but extension provided here - github.com/.../XrmCoreLibrary
I haven't used it before so I have no idea what could cause issues. I would recommend to create an issue in that repo and ask for help from author of the extension.
Hi, sorry for the delay.
This code is for connect to CRM Instance:
var connectionString = @"AuthType=ClientSecret;Url=xxxxxxx.crm.dynamics.com/;ClientID=" + "xxxxxxxxx" + ";ClientSecret=" + "xxxxxxxxxxx";
CrmServiceClient conn = new CrmServiceClient(connectionString);
return new OrganizationServiceManager(conn);
Later, i use this OrganizationServiceManager to execute multiple insert in CRM (_servicio is the return from the connection)
var options = new OrganizationServiceProxyOptions()
{
Timeout = new TimeSpan(0, 40, 0)
};
IDictionary<string, ExecuteMultipleResponse> _resultadoPeticion = _servicio.ParallelProxy.Execute<ExecuteMultipleRequest, ExecuteMultipleResponse>(_colleccionBloques, options);
_callback(_resultadoPeticion, _colleccionBloques, _log, nombreTabla, nombreCampoEstado, nombreAtributoLlave, nombreColumnaLlave, GuardarSQL);
IImportant: This code works well in a console app, but inside a windows service generate the error described.
Hello,
Can you please provide the code that shows how you connect to CRM instance?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,232 Super User 2024 Season 2
Martin Dráb 230,064 Most Valuable Professional
nmaenpaa 101,156