![]() |
VOOZH | about |
dotnet add package Data8.PowerPlatform.Dataverse.Client --version 2.4.2
NuGet\Install-Package Data8.PowerPlatform.Dataverse.Client -Version 2.4.2
<PackageReference Include="Data8.PowerPlatform.Dataverse.Client" Version="2.4.2" />
<PackageVersion Include="Data8.PowerPlatform.Dataverse.Client" Version="2.4.2" />Directory.Packages.props
<PackageReference Include="Data8.PowerPlatform.Dataverse.Client" />Project file
paket add Data8.PowerPlatform.Dataverse.Client --version 2.4.2
#r "nuget: Data8.PowerPlatform.Dataverse.Client, 2.4.2"
#:package Data8.PowerPlatform.Dataverse.Client@2.4.2
#addin nuget:?package=Data8.PowerPlatform.Dataverse.Client&version=2.4.2Install as a Cake Addin
#tool nuget:?package=Data8.PowerPlatform.Dataverse.Client&version=2.4.2Install as a Cake Tool
The Microsoft.PowerPlatform.Dataverse.Client package provides an SDK for connecting to Dataverse & Dynamics 365 instances from .NET Core, but relies on OAuth authentication. This poses a problem when you need to connect to an on-premise instance that either does not support OAuth, or where the OAuth tokens regularly expire and cannot be automatically refreshed.
This package Data8.PowerPlatform.Dataverse.Client
builds on top of the Microsoft one and offers an alternative IOrganizationService implementation using WS-Trust.
This allows you to connect using the URL of the organization service, username and password without any additional
configuration.
Because this OnPremiseClient implements the same IOrganizationService as the standard ServiceClient implementation
your code can work with either as shown in the sample code below.
using Data8.PowerPlatform.Dataverse.Client;
using Microsoft.PowerPlatform.Dataverse.Client;
using Microsoft.Xrm.Sdk;
var onPremIfd = new OnPremiseClient("https://org.crm.contoso.com/XRMServices/2011/Organization.svc", "AD\\username", "password!");
var onPremAD = new OnPremiseClient("https://crm.contoso.com/org/XRMServices/2011/Organization.svc", "AD\\username", "password!");
var online = new ServiceClient("AuthType=ClientSecret;Url=https://contoso.crm.dynamics.com;ClientId=637C79F7-AE71-4E9A-BD5B-1EC5EC9F397A;ClientSecret=p1UiydoIWwUH5AdMbiVBOrEYn8t4RXud");
CreateRecord(onPremIfd);
CreateRecord(onPremAD);
CreateRecord(online);
void CreateRecord(IOrganizationService svc)
{
var entity = new Entity("account")
{
["name"] = "Data8"
};
entity.Id = svc.Create(entity);
}
This package is designed to be used with on-premise Dynamics 365 instances. Supported authentication types are:
The package targets .NET Core 3.1 or later. It can also be used on .NET Framework 4.6.2 or later.
If claims-based authentication is not configured on your Dynamics 365 instance, you will be using Integrated Windows Authentication. This library can authenticate to these instances, but only where the client is either:
gss-ntlmssp package installedYou can choose to supply a username (in the format DOMAIN\Username or username@domain) and password, or leave
both blank to authenticate as the currently logged on user.
This library supports both late-bound and early-bound code. To use early-bound classes, create them using
CrmSvcUtil
or the Early Bound Generator tool in XrmToolBox
as normal. You'll then need to enable them using the EnableProxyTypes method in the same way as the CrmServiceClient uses.
After they are enabled you can pass your early bound instances and get strongly types responses from all the normal
IOrganizationService methods, or use the generated OrganizationServiceContext to interact with the service:
var client = new OnPremiseClient(url, username, password);
client.EnableProxyTypes();
// Using IOrganizationService
var contact = new Contact { FirstName = "Early Bound", LastName = "Context" };
contact.Id = client.Create(contact);
// Using OrganizationServiceContext
var context = new CrmServiceContext(client);
var newContacts = context.ContactSet
.Where(c => c.CreatedOn > DateTime.Today)
.Select(c => new { c.FirstName, c.LastName })
.ToList();
As well as the standard IOrganizationService interface, this library also supports both the IOrganizationServiceAsync
and IOrganizationServiceAsync2 interfaces to allow you to use async programming styles when accessing Dynamics 365 data.
The IOrganizationServiceAsync2 interface supports cancellation. Similar to the Microsoft library, cancellation can only
be performed up to the point the request is sent to the server. Requests cannot be cancelled once they are sent.
Many thanks to Data8 for the time to develop this library and release it for public use.
This project builds on the work of the NSspi library to handle the internals of working with the Windows authentication functions pre-.NET 7. Unfortunately the latest release of NSspi was missing a few required methods, so it is currently including some code from a fork of that library.
This package is not officially supported, either by Data8 or Microsoft. We will attempt to provide support on a best-efforts basis via GitHub issues but can't guarantee we will be able to resolve any specific issues you may have.
Contributions to the package are welcome in the form of suggestions via Issues or bug fixes/enhancements via Pull Requests.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 is compatible. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Framework | net462 net462 is compatible. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
Showing the top 1 NuGet packages that depend on Data8.PowerPlatform.Dataverse.Client:
| Package | Downloads |
|---|---|
|
Data8.DuplicareHelper
Wrapper for using Duplicare in custom code |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.4.2 | 71,314 | 5/29/2024 |
| 2.4.1 | 50,074 | 9/26/2023 |
| 2.4.0 | 7,029 | 9/5/2023 |
| 2.3.2 | 10,720 | 8/24/2023 |
| 2.3.1 | 37,306 | 11/18/2022 |
| 2.3.0 | 13,769 | 10/21/2022 |
| 2.2.0 | 4,121 | 9/12/2022 |
| 2.1.1 | 7,147 | 6/16/2022 |
| 2.1.0 | 931 | 5/19/2022 |
| 2.0.2 | 2,750 | 4/25/2022 |
| 2.0.1 | 1,266 | 3/24/2022 |
| 2.0.0 | 832 | 3/10/2022 |
| 1.0.0 | 1,075 | 11/15/2021 |
| 0.2.2 | 613 | 11/10/2021 |
| 0.2.1 | 616 | 11/9/2021 |
| 0.2.0 | 566 | 11/9/2021 |
| 0.1.0 | 705 | 11/9/2021 |
Fixed errors when using claims based authentication