web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

CrmServiceClient connection stopped working today

(0) ShareShare
ReportReport
Posted on by 255

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 ideas


ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

CrmServiceClient service = new CrmServiceClient(ConfigurationManager.ConnectionStrings["CRM"].ConnectionString);

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: CrmServiceClient connection stopped working today

    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?

  • Stuie Profile Picture
    255 on at
    RE: CrmServiceClient connection stopped working today

    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?

  • TKoller Profile Picture
    181 on at
    RE: CrmServiceClient connection stopped working today

    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..

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: CrmServiceClient connection stopped working today

    Try Xrm.Tooling and there shouldn't be any harm to update Xrm.Sdk package as well.

  • Stuie Profile Picture
    255 on at
    RE: CrmServiceClient connection stopped working today

    Doh!! Do you have an example connection string?

  • TKoller Profile Picture
    181 on at
    RE: CrmServiceClient connection stopped working today

    <add name="MyCDSServer"

     connectionString="

     AuthType=ClientSecret;

     url=contosotest.crm.dynamics.com;

     ClientId={AppId};

     ClientSecret={ClientSecret}"

     />

  • Stuie Profile Picture
    255 on at
    RE: CrmServiceClient connection stopped working today

    Great thanks.

    So this alongside adding an app in Azure this will sort it?

    I connect to the CRM from a web service.

  • TKoller Profile Picture
    181 on at
    RE: CrmServiceClient connection stopped working today

    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

  • Stuie Profile Picture
    255 on at
    RE: CrmServiceClient connection stopped working today

    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=****" />

    :(

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: CrmServiceClient connection stopped working today

    Hello,

    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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 125

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 110 Super User 2025 Season 2

#3
Erin Lubben Profile Picture

Erin Lubben 73

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans