Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

How to Connect Dynamic CRM with ASP.NET Core 2.1 Web API

$
0
0

I want to be able to make CRUD functions using asp.net core and connect to CRM dynamics.

  • I've installed "System.ServiceModel.Primitives", to my Core project.
  • All the tutorials suggest using 
    • Microsoft.Xrm.Sdk.dll
    • Microsoft.Crm.Sdk.Proxy.dll
  • When I added them manually as a reference and tried to connect to the CRM using the following code:
 ClientCredentials credential = new ClientCredentials();
                credential.UserName.UserName = userName;
                credential.UserName.Password = password;
                Uri serviceUri = new Uri(soapOrgServiceUrl);
                ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
                OrganizationServiceProxy proxy = new OrganizationServiceProxy(serviceUri, null, credential, null);
                proxy.EnableProxyTypes();
                return proxy;

I got an exception on runtime"TypeLoadException: Could not load type 'System.ServiceModel.Description.MetadataConversionError' from assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'."

Can anyone help please and tell me how to connect to CRM Dynamics using asp.net core 2.1?


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>