Xrm.DataManager.Framework
2026.0.2
dotnet add package Xrm.DataManager.Framework --version 2026.0.2
NuGet\Install-Package Xrm.DataManager.Framework -Version 2026.0.2
<PackageReference Include="Xrm.DataManager.Framework" Version="2026.0.2" />
<PackageVersion Include="Xrm.DataManager.Framework" Version="2026.0.2" />
<PackageReference Include="Xrm.DataManager.Framework" />
paket add Xrm.DataManager.Framework --version 2026.0.2
#r "nuget: Xrm.DataManager.Framework, 2026.0.2"
#:package Xrm.DataManager.Framework@2026.0.2
#addin nuget:?package=Xrm.DataManager.Framework&version=2026.0.2
#tool nuget:?package=Xrm.DataManager.Framework&version=2026.0.2
Xrm.DataManager.Framework
Framework for massive Microsoft Dataverse data operations (batch jobs, data migrations, purges, synchronizations...).
You write the query and the processing of a single record : the framework handles paging, multi threading, retries, progress and logging.
Features
- Batching patterns : pick and process, full process (with resume), input file, SQL retrieval
- Multi instance : query an instance and process on another one, synchronize or compare tables between instances
- Performances : multi threading, connection pool, server recommended degree of parallelism displayed at startup
- Errors handling : network errors and service protection limits are retried (
Retry-Afterdelay honored) - Tracing : file, Application Insights or any Microsoft.Extensions.Logging provider
- Configuration : connections and settings in
app.config
Only depends on the Dataverse ServiceClient (Microsoft.PowerPlatform.Dataverse.Client).
Getting started
Prerequisites
- Console application targeting .NET Framework 4.8 or .NET 10
- Dataverse connection string in ServiceClient format : OAuth, ClientSecret or Certificate
Configuration
Define connections and settings in app.config :
<configuration>
<connectionStrings>
<add name="Dev" connectionString="AuthType=ClientSecret;Url=https://dev.crm4.dynamics.com;ClientId=...;ClientSecret=..." />
</connectionStrings>
<appSettings>
<add key="Target.Connection.Name" value="Dev" />
<add key="Process.Thread.Number" value="10" />
</appSettings>
</configuration>
Write a job
using Microsoft.Xrm.Sdk.Query;
using System;
using Xrm.DataManager.Framework;
public class DeleteInactiveContactsJob : PickAndProcessDataJobBase
{
public DeleteInactiveContactsJob(JobSettings jobSettings, JobProcessParameters parameters) : base(jobSettings, parameters) { }
public override string GetName() => "Delete inactive contacts";
// Records are retrieved page by page, as long as the query returns records
public override QueryExpression GetQuery(Guid callerId)
{
var query = new QueryExpression("contact");
query.Criteria.AddCondition("statecode", ConditionOperator.Equal, 1);
return query;
}
// Called once per record, on several threads
public override void ProcessRecord(JobExecutionContext context) => context.Proxy.Delete(context.Record.LogicalName, context.Record.Id);
}
Run it
// Default logger : FileLogger ({RunId}.log file in current directory)
using (var processor = new JobProcessor())
{
processor.Execute<DeleteInactiveContactsJob>();
}
Or select connection and jobs from command line (YourApp.exe Dev DeleteInactiveContactsJob,OtherJob) or Target.Job.Names setting :
using (var processor = new Processor())
{
processor.Execute(args);
}
Patterns
| Base class | Usage |
|---|---|
PickAndProcessDataJobBase |
Query a page of records, process them, then loop as long as records are retrieved |
FullProcessDataJobBase |
Query all records, load them in memory and process them (progress file to resume) |
InputFileProcessDataJobBase |
Map a csv or txt file to table / columns and process each line |
CrossInstanceDataJobBase |
Query records on a source instance and process them on the target instance |
SyncDataJobBase |
Copy records from a source instance to the target instance (configurable attribute exclusions) |
CompareDataJobBase |
Compare records between two instances : only in source, only in target, different, equal (CSV report) |
SqlFullProcessDataJobBase |
Query records with SQL on Dataverse TDS endpoint (Xrm.DataManager.Framework.Tds package) |
Overridable methods : PreOperation (before processing, ex : disable audit), PrepareData (ex : groupings), PostOperation (after processing, ex : notification), IsEnabled, OverrideThreadNumber...
Main settings
Key (appSettings) |
Default | Description |
|---|---|---|
Target.Connection.Name |
— | connectionStrings entry where jobs run (single entry or console selection if not defined) |
Source.Connection.Name |
— | connectionStrings entry to read records from (multi instance patterns) |
Target.Job.Names |
— | Jobs run by Processor (class names separated with ',') |
Process.Thread.Number |
5 | Number of threads |
Process.Query.RecordLimit |
2500 | Records retrieved per page (max 5000) |
LogLevel |
1 | 0 : Verbose, 1 : Information, 2 : ErrorsAndSuccess, 3 : ErrorsOnly |
See the complete settings list.
Additional packages
| Package | Description |
|---|---|
| Xrm.DataManager.Framework.ApplicationInsights | Application Insights logger |
| Xrm.DataManager.Framework.Tds | Retrieve records with SQL (Dataverse TDS endpoint) |
Documentation
- Complete documentation : logging, SQL retrieval, multi instance processing, synchronization, comparison
- Upgrade guide from 2022.x versions (ServiceClient, connections, renamed settings)
Feedback
Questions, bugs and suggestions : GitHub issues. Community contributions are welcome !
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
- Microsoft.PowerPlatform.Dataverse.Client (>= 1.2.27)
-
net10.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
- Microsoft.PowerPlatform.Dataverse.Client (>= 1.2.27)
- System.Configuration.ConfigurationManager (>= 10.0.14)
- System.Security.Cryptography.Pkcs (>= 10.0.14)
- System.Security.Cryptography.Xml (>= 10.0.14)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Xrm.DataManager.Framework:
| Package | Downloads |
|---|---|
|
Xrm.DataManager.Framework.Tds
Retrieve Dataverse records with SQL (TDS endpoint) for Xrm.DataManager.Framework |
|
|
Xrm.DataManager.Framework.ApplicationInsights
Application Insights logger for Xrm.DataManager.Framework |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2026.0.2 | 121 | 10/26/2026 |
| 2026.0.1 | 116 | 10/26/2026 |
| 2022.6.17.1850 | 2,302 | 6/17/2022 |
| 2022.6.17.1810 | 609 | 6/17/2022 |
| 2022.3.23.1610 | 737 | 3/23/2022 |
| 2022.3.9.1615 | 671 | 3/9/2022 |
| 2022.3.9.1300 | 625 | 3/9/2022 |
| 2022.3.9.1100 | 616 | 3/9/2022 |
| 2022.3.8.1300 | 644 | 3/8/2022 |
| 2021.10.12.1822 | 2,303 | 10/12/2021 |
| 2021.1.27.1052 | 891 | 1/27/2021 |
| 2021.1.27.1040 | 595 | 1/27/2021 |
| 2021.1.27.1017 | 588 | 1/27/2021 |
| 2021.1.25.1116 | 609 | 1/25/2021 |
| 2021.1.25.1030 | 566 | 1/25/2021 |
| 2021.1.25.1029 | 565 | 1/25/2021 |
| 2021.1.25.113 | 568 | 1/25/2021 |
| 2021.1.25.110 | 583 | 1/25/2021 |
| 2021.1.21.1923 | 632 | 1/21/2021 |
| 2021.1.21.1922 | 606 | 1/21/2021 |