Accessing Microsoft Dynamics from UWP app

0

I'm trying to create a UWP app to do some stuff with Microsoft Dynamics 365.

The libraries I need are part of this nuget package: Microsoft.CrmSdk.CoreAssemblies

If I try to install the latest version, I get the error:

NU1202  Package Microsoft.CrmSdk.CoreAssemblies 9.0.2.12 is not compatible 
with uap10.0.16299 (UAP,Version=v10.0.16299). 
Package Microsoft.CrmSdk.CoreAssemblies 9.0.2.12 supports: net462 (.NETFramework,Version=v4.6.2)

I'm able to successfully install an older version of the nuget package (9.0.2.5), and it all compiles.

But when I try to create a new OrganizationWebProxyClient(uri, false);

I get this error:

System.MissingMethodException
  HResult=0x80131513
  Message=Method not found: 'Void System.ServiceModel.ClientBase`1..ctor(System.ServiceModel.Description.ServiceEndpoint)'.
  Source=Microsoft.Xrm.Sdk
  StackTrace:
   at Microsoft.Xrm.Sdk.WebServiceClient.WebProxyClient`1..ctor(Uri serviceUrl, Boolean useStrongTypes)
   at Microsoft.Xrm.Sdk.WebServiceClient.OrganizationWebProxyClient..ctor(Uri serviceUrl, Boolean useStrongTypes)
   at MyProject.Myclass.GetDynamicsSvc() 

Which from my googling seems to be an indication of some library version mismatch, but I'm not sure how to solve this.

Edit:

Here is the function that tries to create a new OrganizationWebProxyClient

public static OrganizationWebProxyClient GetDynamicsSvc()
{
    var uriString = $"http://{AppResources.CrmUrl}/xrmservices/2011/organization.svc/web%20SdkClientVersion=9.0";
    var uri = new Uri(uriString);

    var svc = new OrganizationWebProxyClient(uri, false);
    svc.HeaderToken = GetCRMToken();
    svc.InnerChannel.OperationTimeout = new TimeSpan(9, 9, 9);
    return svc;
}

I just tried playing around with the uri a bit, by setting ClientVersion=9.0.2.5, but I get the same error.

uwp
dynamics-crm
asked on Stack Overflow Jul 24, 2019 by Ash • edited Jul 24, 2019 by Ash

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0