I came across this issue wherein when i was trying to use QueryExpression/FetchXML in my Windows/Console Application, i was getting Object reference error in Dynamics CRM 365 Online
When i digged into this further i could see the proxyservice was showing as null in the debug mode. You will not get any error when obtaining the connection.
it generally happens when you are using tooling connector for connection to dynamics crm 365 Online.
In order to resolve the issue you have to specify the security protocol before you make calls to your Microsoft.Xrm.Tooling assembly.
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
the connection to dynamics 365 will not be available unless TLS12 is being used as Security Protocol.connection.
it should look like below:
I hope this helps!
cheers!
MFA could also be one of the reasons for it
https://nishantrana.me/2020/10/16/fixed-unable-to-login-to-dynamics-crm-or-an-unsecured-or-incorrectly-secured-fault-was-received-from-the-other-party-see-the-inner-faultexception-for-the-fault-code-and-detail/
LikeLike