Hi,
I am getting the following exception (after my code runs for some time and updates some records) when I run ExecuteMultipleRequest in parallel using Parallel.ForEach :
Exception thrown: 'System.ServiceModel.Security.SecurityNegotiationException' in Microsoft.Xrm.Sdk.dll
The application terminated with an error.
Secure channel cannot be opened because security negotiation with the remote endpoint has failed. This may be due to absent or incorrectly specified EndpointIdentity in the EndpointAddress used to create the channel. Please verify the EndpointIdentity specified or implied by the EndpointAddress correctly identifies the remote endpoint.
The request for security token has invalid or malformed elements.
My code runs properly until I set MaxDegreeOfParallelism greater than 3.
I have used "service.Timeout = new Timespan(0,30,0);"
and I have also included the following binding in app.config
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding openTimeout="00:50:00"
closeTimeout="00:50:00"
sendTimeout="00:50:00"
receiveTimeout="00:50:00">
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>
How can I fix this error ??
Also the authentication type for my Crm instance is AD so the SecurityTokenResponse is null for the OrganisationServiceProxy (in case this information is related to the exception).
*This post is locked for comments