Today I got the below error while running an console application which retrives account details from CRM.
Value cannot be null.\r\nParameter name: identityProvider
And that code was working earlier, not sure what went wrong and started searching here and there.
Finally, came to know that there was an extra space in the UserName which I have given as an input for the application to connect to CRM. Removed the space and able to perform my task.
Note : There could be many other reasons causing this issue and this wrong username or extra characters is one of them.
Hope this helps.