Xrm Tools v1.4 – Smarter Code Generation, One-Click Registrations, and Compile-Time Dependency Injection
Xrm Tools v1.4 introduces compile-time, thread-safe dependency injection for Power Platform plugins and custom APIs, smarter one-click registrations, enriched metadata, and optimizations—helping developers focus on business logic while the tool handles the complexity.

I’m excited to announce the release of Xrm Tools v1.4, bringing a major step forward in productivity and safety for Power Platform developers. This version introduces a compile-time dependency injection (DI) framework specifically designed for plugins and custom APIs, along with smarter one-click registrations, enriched metadata, and numerous bug fixes and optimizations.
If you’ve already used Xrm Tools for typed parameters, one-click registrations, and code generation, you’ll now benefit from a new, safe, and extremely fast dependency injection model—all without runtime penalties.
Compile-Time Dependency Injection
Dependency injection in plugins has always been a challenge. Traditional approaches often come with performance costs or thread-safety concerns.
With Xrm Tools v1.4, DI is handled differently:
- Code is generated at compile-time – meaning the entire dependency management layer is baked into your assembly.
- Thread-safe by design – no manual locking or boilerplate.
- Simple usage – dependencies are accessed as if they were regular properties.
[Plugin]
[Step("Create", "account", "name, description,accountnumber", Stages.PreOperation, ExecutionMode.Synchronous)]
public partial class AccountWelcomePlugin : IPlugin
{
[Dependency]
IWelcomeService WelcomeService { get => DependencyScope<AccountCreatePlugin>.Current.Require<IWelcomeService>(); }
public void Execute(IServiceProvider serviceProvider)
{
using (var scope = CreateScope(serviceProvider))
{
Target.Description = WelcomeService.Welcome(Target);
}
}
}
public interface IWelcomeService
{
string Welcome(TargetAccount);
}
public class AccountWelcomeService : IWelcomeService
{
public string Welcome(TargetAccount account)
{
return $"Welcome to CRM, {account.Name}! "
+ "Oh wait!, I mean Dynamics 365! "
+ "wait, wait, wait, I mean Power Platform.";
}
}
The rules are simple:
- Mark your dependencies with [Dependency] attribute.
- Read your dependencies by calling
Require<T>
method. - Put your code in a dependency scope by calling
CreateScope
. This makes your dependencies thread-safe.
This makes writing complex business logic easier, safer, and faster—without sacrificing performance.
💡 Hint
If you think DependencyScope<AccountWelcomePlugin>.Current.Require<IWelcomeService>()
is too long, write a helper method like the following in your base class:
protected static T Require<T>() =>
DependencyScope<TPlugin>.Current.Require<T>();
Then your properties become easier to read:
[Dependency]
public IWelcomeService WelcomeService { get => Require<IWelcomeService>(); }
There is more advanced stuff that you can do. To learn more, read Dependency Injection page in the wiki.
Smarter One-Click Registrations
The one-click registration feature also received significant upgrades.
- If you register a plugin and another one has been removed, Xrm Tools now detects the mismatch.
- The tool intelligently determines if your assembly is incompatible.
- If you are registering the entire project, the cleanup is done automatically.
- If you are registering a single plugin, you’ll be prompted to safely remove deleted plugins from the environment.
The result? Confidence that your environment matches your codebase, with no manual work.

Optimizations and Bug Fixes
While developing and testing these new features, I also took the opportunity to refine the core experience:
- Optimized code generation for richer metadata and new scenarios.
- Smarter extension behavior with better defaults and safer workflows.
- Several bug fixes to make the extension more reliable and intuitive.
Focus on Business Logic, Not Rituals
The goal of Xrm Tools has always been simple: help developers focus on business requirements while the extension takes care of the complex details.
With v1.4, developers can:
- Generate strongly-typed code and metadata with confidence.
- Use dependency injection in plugins without runtime costs or risks.
- Register plugins and custom APIs safely with smarter one-click actions.
All of this makes Xrm Tools an even more powerful companion for Power Platform development.
Xrm Tools v1.4 is now available—upgrade today and experience safer, smarter, and faster development for your Power Platform plugins and custom APIs.
👉Don't forget to 5-star if you liked the Xrm Tools in Visual Studio Marketplace