Closed bnemetchekBlackfoot closed 6 months ago
Can you provide more information the auth type your trying to use and if your trying to connect to Online or Onprem? if you are connecting in Online, can you tell us what the domain name is for your org?
It's online, using a client ID and secret. https://btcce.crm.dynamics.com
Thanks for looking into this.
Ok, so given the error you seeing, it implies that there is a proxy or some sort of replicate between your code and the remote service that is trying to answer web requests that the client is making to define its connector.
if that is not the case or you do not know, I would ask you to open a support request to help troubleshoot this as its going to go into specific information about your environment and networking configuration.
thanks
I stumbled upon this post after having no luck trying to find the fix.
Turns out that Microsoft.PowerPlatform.Dataverse.Client
has implicit dependencies on older version of System.ServiceModel.Http
(version 4.x). And this causes the issue.
Explicitly adding System.ServiceModel.Http
version 8.0.0
fixes this for me.
My project is running .NET 8.0.100 - was migrated from multi-targeting net8.0
and net472
to pure net8.0
recently, and this was breaking after the migration.
Note: I also have System.ServiceModel.Primitives
version 8.0.0
installed - not sure if this is required or not.
Hope this helps!
I tried the 2 nuget suggestions above that but didn't fix the issue. I upgraded to the latest version of the DataverseServiceClient, 1.1.32, and it's working now.
When trying to create a new ServiceClient, I get the error below. This is in a .NET core 8 WPF application.
var service2 = new ServiceClient(instanceUrl: serviceUrl, async (instanceUri) => { var auth = await GetToken(); return auth.AccessToken; });
{"Failed to connect to Dataverse"} {"The CustomBinding on the ServiceEndpoint with contract 'IOrganizationService' lacks a TransportBindingElement. Every binding must have at least one binding element that derives from TransportBindingElement."}