Hi. I've been using the CrmServiceClient with Tls12 in C# for a while now but last night it stopped working. The LastCRMError is "Unable to Login to Dynamics CRM"I haven't made any changes to this and testing the connection with XrmToolBox succeeds.Any ideasServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
CrmServiceClient service = new CrmServiceClient(ConfigurationManager.ConnectionStrings["CRM"].ConnectionString);
Hello,
Try to update the package from NuGet and clean/rebuild your solution.
What connection string and authentication approach your code uses?
Any chance 2Fact auth was enabled for the user you use to connect?
Hi
Conn String is
<add name="CRMLIVE" connectionString="RequireNewInstance=True;AuthType=Office365;Url=https://*****.crm4.dynamics.com;Username=info@****com;Password=**** />
I doubt F2 was enabled but Il'l check and try an update.Is the update for just the xrm.tooling?
we are facing the same issue.
This is because you are not allowed to use office365-authentication anymore in server-applications.
https://docs.microsoft.com/en-us/power-platform/important-changes-coming#deprecation-of-office365-authentication-type-and-organizationserviceproxy-class-for-connecting-to-dataverse
you have to use an azure app for authentication (clientid/clientsecret)
they wrote it will shutdown on april 2022 for existing environments but yesterday they just changed this....now we have some fun updating applications..
Try Xrm.Tooling and there shouldn't be any harm to update Xrm.Sdk package as well.
Doh!! Do you have an example connection string?
<add name="MyCDSServer"
connectionString="
AuthType=ClientSecret;
url=contosotest.crm.dynamics.com;
ClientId={AppId};
ClientSecret={ClientSecret}"
/>
Great thanks.
So this alongside adding an app in Azure this will sort it?
I connect to the CRM from a web service.
yes, microsoft wants you to use an azureapp with clientid/clientsecret for server2server-communication.
here is a tutorial for creating an app and registering in dynamics.
https://blog.magnetismsolutions.com/blog/johntowgood/2018/03/08/dynamics-365-online-authenticate-with-client-credentials
Hi. I've tried this but I'm getting nowhere.
I've set up an Azure app, got the secret and app id, and used the following conn string with CrmServiceClient.
<add name="CRMLIVE" connectionString="AuthType=ClientSecret;url=https://***.crm4.dynamics.com;ClientId=******;ClientSecret=****" />
:(
I used App User multiple times and it worked fine for me. I believe you missed something.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
MVP-Daniyal Khaleel 125
Tom_Gioielli 110 Super User 2025 Season 2
Erin Lubben 73