Maui with CRM / XRM nuget

Viewed 23

I am trying to develop a Maui application using VS2022 to connect to an on premise CRM365 API and retrieve some data.

When adding Microsoft.CrmSdk.XrmTooling.CoreAssembly many errors appear. Is it not compatible with Maui? Is there anyway to speak to CRM365 on premise from Maui?

Errors:

Severity    Code    Description Project File    Line    Suppression State
Error   NU1605  Detected package downgrade: Microsoft.Win32.Primitives from 4.3.0 to 4.0.1. Reference the package directly from the project to select a different version. 
 DAA -> Microsoft.CrmSdk.XrmTooling.CoreAssembly 9.1.1.1 -> Microsoft.IdentityModel.Clients.ActiveDirectory 3.19.8 -> NETStandard.Library 1.6.0 -> System.Net.Primitives 4.0.11 -> runtime.win.System.Net.Primitives 4.3.0 -> Microsoft.Win32.Primitives (>= 4.3.0) 
 DAA -> Microsoft.CrmSdk.XrmTooling.CoreAssembly 9.1.1.1 -> Microsoft.IdentityModel.Clients.ActiveDirectory 3.19.8 -> NETStandard.Library 1.6.0 -> Microsoft.Win32.Primitives (>= 4.0.1)    Project1.csproj 1   
-----------------------------------------------------------------
Severity    Code    Description Project File    Line    Suppression State
Error   NU1605  Detected package downgrade: System.Net.Primitives from 4.3.0 to 4.0.11. Reference the package directly from the project to select a different version. 
 DAA -> Microsoft.CrmSdk.XrmTooling.CoreAssembly 9.1.1.1 -> Microsoft.IdentityModel.Clients.ActiveDirectory 3.19.8 -> NETStandard.Library 1.6.0 -> System.Net.Sockets 4.1.0 -> runtime.unix.System.Net.Sockets 4.3.0 -> System.Net.Primitives (>= 4.3.0) 
 DAA -> Microsoft.CrmSdk.XrmTooling.CoreAssembly 9.1.1.1 -> Microsoft.IdentityModel.Clients.ActiveDirectory 3.19.8 -> NETStandard.Library 1.6.0 -> System.Net.Primitives (>= 4.0.11)    Project1.csproj 1   
1 Answers

Microsoft.CrmSdk.XrmTooling.CoreAssembly is a NuGet package built on .NET Framework 4.6.2. It is not compatible with MAUI, which is on .NET 6.0 or higher.

When connecting with Dynamics 365 CE from MAUI, try package Microsoft.PowerPlatform.Dataverse.Client. It is pretty new and designed for .NET Core and Dynamics 365 Online, but it seems to be the new way to connect to D365.

See also:

Related