![]() |
VOOZH | about |
dotnet add package XrmPluginCore.Abstractions --version 1.1.0
NuGet\Install-Package XrmPluginCore.Abstractions -Version 1.1.0
<PackageReference Include="XrmPluginCore.Abstractions" Version="1.1.0" />
<PackageVersion Include="XrmPluginCore.Abstractions" Version="1.1.0" />Directory.Packages.props
<PackageReference Include="XrmPluginCore.Abstractions" />Project file
paket add XrmPluginCore.Abstractions --version 1.1.0
#r "nuget: XrmPluginCore.Abstractions, 1.1.0"
#:package XrmPluginCore.Abstractions@1.1.0
#addin nuget:?package=XrmPluginCore.Abstractions&version=1.1.0Install as a Cake Addin
#tool nuget:?package=XrmPluginCore.Abstractions&version=1.1.0Install as a Cake Tool
👁 XrmPluginCore NuGet Version
👁 XrmPluginCore.Abstractions NuGet Version
XrmPluginCore provides base functionality for developing plugins and custom APIs in Dynamics 365. It includes context wrappers and registration utilities to streamline the development process.
Plugin.RegisterStep helper method.Create a service interface and concrete implementation:
namespace Some.Namespace {
interface IMyService {
void DoSomething();
}
public class MyService : IMyService {
private readonly IOrganizationService _service;
private readonly IPluginExecutionContext _context;
public MyService(IOrganizationServiceFactory serviceFactory, IPluginExecutionContext pluginExecutionContext) {
// Store references to the services if needed
_service = _serviceFactory.CreateOrganizationService(pluginExecutionContext.UserId);
_context = pluginExecutionContext;
});
public void DoSomething() {
// Implementation here
var rand = new Random();
var newAcc = new Account(_context.PrimaryEntityId) {
Fax = rand.Next().ToString()
};
_service.Update(newAcc);
}
}
}
Create a base-plugin class that registers the service. Only do this once per assembly, and register all your custom services here:
using XrmPluginCore;
namespace Some.Namespace {
public class BasePlugin : Plugin {
protected override IServiceCollection OnBeforeBuildServiceProvider(IServiceCollection services)
{
return services.AddScoped<IMyService, MyService>();
}
}
}
Finally, create your plugin class that inherits from the base-plugin, and use dependency injection to get your service:
using System;
using XrmFramework.BusinessDomain.ServiceContext;
using XrmPluginCore;
using XrmPluginCore.Enums;
namespace Some.Namespace {
public class AccountChainPostPlugin : BasePlugin {
public AccountChainPostPlugin() {
RegisterStep<Account, IMyService>(
EventOperation.Update,
ExecutionStage.PostOperation,
s => s.DoSomething())
.AddFilteredAttributes(x => x.Fax);
}
}
}
NOTE: This is only support to support legacy DAXIF/XrmFramework style plugins. It is recommended to use dependency injection based plugins instead.
namespace Some.Namespace {
using System;
using XrmFramework.BusinessDomain.ServiceContext;
using XrmPluginCore;
using XrmPluginCore.Enums;
public class AccountChainPostPlugin : Plugin {
public AccountChainPostPlugin() {
RegisterPluginStep<Account>(
EventOperation.Update,
ExecutionStage.PostOperation,
ExecutePlugin)
.AddFilteredAttributes(x => x.Fax);
}
protected void ExecutePlugin(LocalPluginContext localContext) {
if (localContext == null) {
throw new ArgumentNullException("localContext");
}
var service = localContext.OrganizationService;
var rand = new Random();
var newAcc = new Account(localContext.PluginExecutionContext.PrimaryEntityId) {
Fax = rand.Next().ToString()
};
service.Update(newAcc);
}
}
}
The following services are available for injection into your plugin or custom API classes:
| Service | Description |
|---|---|
| Extension to ITracingService with additional helper methods. | |
| ILogger 🔗 | The Plugin Telemetry Service logger interface. |
| IOrganizationServiceFactory 🔗 | Represents a factory for creating IOrganizationService instances. |
| IPluginExecutionContext 🔗 | The plugin execution context provides information about the current plugin execution, including input and output parameters, the message name, and the stage of execution. |
| IPluginExecutionContext2 🔗 | Extension to IPluginExecutionContext with additional properties and methods. |
| IPluginExecutionContext3 🔗 | Extension to IPluginExecutionContext2 with additional properties and methods. |
| IPluginExecutionContext4 🔗 | Extension to IPluginExecutionContext3 with additional properties and methods. |
| IPluginExecutionContext5 🔗 | Extension to IPluginExecutionContext4 with additional properties and methods. |
| IPluginExecutionContext6 🔗 | Extension to IPluginExecutionContext5 with additional properties and methods. |
| IPluginExecutionContext7 🔗 | Extension to IPluginExecutionContext6 with additional properties and methods. |
| ITracingService 🔗 | The tracing service interface. The actual class is the ExtendedTracingService wrapping the built-in ITracingService |
Note: Links marked with 🔗 point to official Microsoft documentation.
To register additional services, override the OnBeforeBuildServiceProvider method in your plugin or custom API class.
Use XrmSync to automatically register relevant plugin steps and images.
XrmPluginCore and XrmSync does not currently support Dependent Assemblies. If your plugin depends on other assemblies, you can use ILRepack or a similar tool to merge the assemblies into a single DLL before deploying.
To ensure XrmPluginCore, and it's dependencies are included, you can use the following settings for ILRepack:
<Target Name="ILRepack" AfterTargets="Build">
<ItemGroup>
<InputAssemblies Include="$(TargetPath)" />
<InputAssemblies Include="$(TargetDir)Microsoft.Bcl.AsyncInterfaces.dll" />
<InputAssemblies Include="$(TargetDir)Microsoft.Extensions.DependencyInjection.Abstractions.dll" />
<InputAssemblies Include="$(TargetDir)Microsoft.Extensions.DependencyInjection.dll" />
<InputAssemblies Include="$(TargetDir)XrmPluginCore.Abstractions.dll" />
<InputAssemblies Include="$(TargetDir)XrmPluginCore.dll" />
</ItemGroup>
<Exec Command="$(PkgILRepack)\tools\ILRepack.exe /parallel /keyfile:[yourkey].snk /lib:$(TargetDir) /out:$(TargetDir)ILMerged.$(TargetFileName) @(InputAssemblies -> '%(Identity)', ' ')" />
</Target>
Contributions are welcome! Please submit a pull request or open an issue to discuss your ideas.
This project is licensed under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. 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 was computed. 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 Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 2 NuGet packages that depend on XrmPluginCore.Abstractions:
| Package | Downloads |
|---|---|
|
XrmMockup365
Engine which simulates your exact Dynamics 365/CRM instance locally including all of it's logic! |
|
|
XrmPluginCore
XrmPluginCore provides base functionality for developing plugins and custom APIs in Dynamics 365. It includes context wrappers and registration utilities to streamline the development process. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.0 | 13,773 | 10/8/2025 |
| 1.0.0 | 303 | 10/1/2025 |
| 1.0.0-local | 721 | 12/3/2025 |