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?
*This post is locked for comments