Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to connect Asp net core app to dynamic CRM 365

Posted on by 195

Hi can anyone give me some suggestion i need to call Dynamic 365 Api through my asp core app, but i found some several tutorial but i can't make it works. Can anyone give me best practices to do that in asp net core.  Here is my code below its not highlight any error but when i try to run it  it give me this error message Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

public string GetAuthToken()
{

// TODO Substitute your app registration values that can be obtained after you
// register the app in Active Directory on the Microsoft Azure portal.
string clientId = ""; // Client ID after app registration
string userName = "";
string password = "";
UserCredential cred = new UserCredential(userName, password);

// Authenticate the registered application with Azure Active Directory.
AuthenticationContext authContext = new AuthenticationContext("login.windows.net/common", false);
AuthenticationResult result = authContext.AcquireToken(serviceUri, clientId, cred);
return result.AccessToken;
}


*This post is locked for comments

  • Keysersozeey Profile Picture
    Keysersozeey 195 on at
    RE: How to connect Asp net core app to dynamic CRM 365

    Im using Net core 2.2 right now

  • Suggested answer
    Rawish Kumar Profile Picture
    Rawish Kumar 13,756 on at
    RE: How to connect Asp net core app to dynamic CRM 365

    Hi There,

    Could you please tell me what is your .net core version , it should be 2.0.

    also other thing you can try is to reload dll ( from nuget).

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans