Personalized Community is here!
Quickly customize your community to find the content you seek.
Have questions on moving to the cloud? Visit the Dynamics 365 Migration Community today! Microsoft’s extensive network of Dynamics AX and Dynamics CRM experts can help.
2022 Release Wave 1 PlanDynamics 365 release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.
2022 release wave 1 plan
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Community | FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
I have a Visual Studio 2017 solution that contains a .Net Core 2.0 console application. I need to access the API of an on-premises CRM 2013 system from the console application, so I created a .Net 4.0 class library in the same solution. In the class library I used Nuget to download Microsoft.CrmSdk.CoreAssemblies, which installed references to Microsoft.Xrm.Sdk and Microsoft.Crm.Sdk.Proxy. I added FetchXml-based data access code to the class library, referenced the class library project from the console application, and rebuilt the solution without errors.
But when I run the console application, I get the following run-time exception whenever the console application instantiates an object from the class library that contains a using statement for Microsoft.Xrm.Sdk:
Could not load file or assembly 'Microsoft.Xrm.Sdk, Version=18.104.22.168, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
I confirmed that the Microsoft.Xrm.Sdk.dll file is being copied to the bin sub-folder from which the console application is executing.
I’ve tried using different versions of Microsoft.CrmSdk.CoreAssemblies from 6.0.4 to 22.214.171.124, and I’ve tried those versions in combination with .Net 4.0, .Net 4.5, and .Net 4.5.2 versions of the class library, but I always get the same exception message.
Any suggestions about how I can access a CRM 2013 Api from a .Net Core 2.0 console application?
If you have to use .Net 2.0 in the console application, then you'll need to access the CRM web services as a web reference to the Organization.svc web service. This is straightforward if you use AD authentication, but if you use Claims authentication it's a bit harder, though you can use the wsdlbasedproxies sample code in the SDK to do most of the work.
Note that with a web reference, you don't get most of the helper code and collections that are in the Crm assemblies. However, you can get broadly equivalent code by following the steps in the 'Use the SOAP Endpoint for Web Resources with Silverlight' documentation in the SDK
Business Applications communities