Skip to content

Bump Pure.DI from 2.1.72 to 2.4.3#173

Open
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/nuget/extensions/TeCLI.Extensions.PureDI/Pure.DI-2.4.3
Open

Bump Pure.DI from 2.1.72 to 2.4.3#173
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/nuget/extensions/TeCLI.Extensions.PureDI/Pure.DI-2.4.3

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Jun 22, 2026

Copy link
Copy Markdown
Contributor

Updated Pure.DI from 2.1.72 to 2.4.3.

Release notes

Sourced from Pure.DI's releases.

2.4.3

This release focuses on improving compatibility, enhancing project templates, and expanding built-in support for standard .NET types.

🚀 New Features

  • Native AOT Support: Pure.DI.MS now fully supports Native AOT compilation, enabling better compatibility with modern .NET applications.
  • Enhanced Project Templates: Improved templates with automatic version configuration make creating new projects faster and more convenient.
  • Extended Built-in Type Support: Added out-of-the-box support for additional .NET standard types including TaskCompletionSource, CultureInfo, IFormatProvider, RandomNumberGenerator, IReadOnlySet, TimeProvider, and StringComparer.

🐞 Bug Fixes

  • Improved Native AOT compatibility in Pure.DI.MS.
  • Better handling of version placeholders in project templates.
  • Optimized code generation for improved performance and reduced overhead.

🎨 Improvements

  • More readable generated code with improved formatting and detailed comments.
  • Enhanced documentation with better examples and getting started guides.
  • Optimized performance by removing unnecessary synchronization in generated code.

Full Changelog: DevTeam/Pure.DI@2.4.2...2.4.3

2.4.2

🚀 Improvements

  • Emit _lock field only when actually used. The thread-safety _lock field is no longer emitted in generated compositions when no lock(...) statement references it. Previously it was created conservatively for any composition with overrides, wasting memory on every instance. No behavioral changes for compositions that genuinely require thread safety.

🐛 Bug Fixes

  • Fix nullable reference type support. Distinguish T and T? in DI contracts and fix invalid ?? generated for nullable generic singleton dependencies.

Full Changelog: DevTeam/Pure.DI@2.4.1...2.4.2

2.4.1

🚀 New Features

Enhanced Code Generation

  • Improved type handling and formatting logic for better class diagram generation
  • Optimized Local Functions Logic — performance improvements in local function handling

🐛 Bug Fixes

Localization Issues — fixed localization problems across multiple language resource files. Updated all localization strings for Arabic, Bengali, German, Spanish, French, Hebrew, Hindi, Indonesian, Italian, Japanese, Korean, Portuguese, Russian, Thai, Vietnamese, and Chinese

Full Changelog: DevTeam/Pure.DI@2.4.0...2.4.1

2.4.0

❗ Breaking Changes

  • Nullable Reference Types — This release introduces full support for nullable reference types, which changes how Pure.DI handles nullable types throughout the pipeline. Code that previously relied on automatic null checks for nullable arguments may need adjustment.

🚀 New Features

  • Nullable Reference Types — Breaking change! Pure.DI now fully preserves nullable reference type annotations throughout the dependency injection pipeline.

    • Nullable composition arguments (.Arg<T?>()) and root arguments (.RootArg<T?>()) no longer generate null checks, allowing null values to flow through as intended.
    • Non-null bindings can satisfy nullable dependencies — useful for optional constructor parameters, nullable factory results, and nullable collection elements.
    • Type system integration: nullable annotations are preserved when reading contracts, building graphs, and generating composition members.
    • Generic constraint awareness: prefer where T : class? over where T : class for contracts with nullable generic arguments to avoid C# compiler warnings.
    • New warnings for ambiguous nullable root types in Resolve methods help catch potential issues early.
    • See readme/nullable-reference-types.md for detailed examples and best practices.
  • TryBuildUp for Builders

    • New TryBuildUp method generated alongside BuildUp for safe type-based composition.
    • Returns false instead of throwing when the runtime subtype is unknown, enabling graceful fallback handling.
    • Example: composition.TryBuildUp(externalRobot) returns false for unsupported types while composition.BuildUp(externalRobot) would throw ArgumentException.
    • See readme/builders.md for usage examples.

👥 Contributors

Thanks to everyone who contributed to this release:

  • Adam Hathcock (@​adamhathcock)
  • Nikolay Pianikov (@​NikolayPianikov)

Full Changelog: DevTeam/Pure.DI@2.3.7...2.4.0

2.3.7

🚀 New Features

  • Generate Interfaces from Classes — special thanks to Adam Hathcock for designing and implementing this feature! 🎉

  • Scope Setup

    • New SetupScope method for composing scoped sub-graphs from a parent composition — open a scope per request/operation, share scoped instances inside it, and dispose them at the end.
    • Scopes can be produced by factory methods, enabling custom scope creation logic.
    • Parent and child scopes are validated to be distinct, preventing accidental self-nesting.
    • New Hint.ScopeMethodName hint lets you rename the generated scope factory method to fit your domain (e.g. SetupScope, CreateScope, BeginRequest):
      DI.Setup()
          .Hint(Hint.ScopeMethodName, "SetupScope")
          .Bind().As(Scoped).To<RequestContext>();
  • Unity Scene Scopes

    • New Unity scene scopes scenario: each loaded Unity scene gets its own scope, so scoped services are shared within a scene and isolated between scenes — Unity creates the MonoBehaviour instances and Pure.DI builds them up.
  • Microsoft DI Integration: Scoped Lifetimes

    • IServiceProvider integration now supports scoped lifetimes end-to-end via composition.CreateScope(), matching Microsoft.Extensions.DependencyInjection semantics.
    • Tag-based resolution and value-type roots are supported through the integration.
  • Generated Code is Marked

    • All generated code is now decorated with [GeneratedCode], so analyzers, coverage, and code-style tools can recognize and skip it correctly.
    • The generated Composition class embeds the actual Pure.DI package version it was produced with, instead of a hard-coded string.

🐛 Bug Fixes

  • Fixed scoped/singleton instance propagation through nested scopes.
  • Fixed read-only handling of setup-context arguments inside generated scope methods.

👥 Contributors

Thanks to everyone who contributed to this release:

  • Adam Hathcock (@​adamhathcock)
  • Nikolay Pianikov (@​NikolayPianikov)

Full Changelog: DevTeam/Pure.DI@2.3.6...2.3.7

2.3.6

🚀 New Features

  • BCL Dictionary Support

    • Added support for injecting .NET Base Class Library Dictionary<TKey, TValue> types
    • Extended injection capabilities to cover standard dictionary types from BCL
  • IContext Extensions

  • Extended Factory Method Bindings

    • Added support for up to 16-parameter factory method bindings
    • Increased from previous limit, supporting more complex factory scenarios

⚡ Performance Improvements

  • Metadata Analysis

    • Optimized metadata analysis pipeline
    • Reduced overhead in setup metadata detection
  • Code Generation

    • Optimized factory code generation with reduced allocations
    • Optimized type resolution process
  • Graph Building

    • Reduced semantic analysis overhead by favoring syntactic analysis
    • Improved graph construction performance

📝 Documentation

  • Updated and improved README documentation
  • Added "Article Basics" documentation

Full Changelog: DevTeam/Pure.DI@2.3.5...2.3.6

2.3.5

🐛 Bug Fixes

  • #​140 Incorrect generated code for the PerBlock lifetime: a local or parameter named ... cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter
  • #​141 Objects created without explicit binding began to use the specified default lifetime instead of Transient

Contributors

@​YoshihiroIto
@​NikolayPianikov

Full Changelog: DevTeam/Pure.DI@2.3.4...2.3.5

2.3.4

🚀 New Features

  • Auto-Bindings Default Lifetime Support

    • Added support for default lifetime configuration in auto-bindings
    • Improves consistency and reduces manual configuration
  • Anonymous Roots (#​138)

    • Made anonymous roots lightweight
    • Reduced memory footprint and improved performance for anonymous root scenarios

🐛 Bug Fixes

  • #​132: Fixed optional enum default value emission

    • Fixed issue where optional enum default values were emitted as int literals, causing CS1503 compilation error
    • Enum default values from other assemblies are now correctly generated
    • Enhanced handling of explicit default values for enum types in dependency injection
  • #​133: Fixed null parameter issue in self-injecting registrations

    • Fixed issue where null was passed as parameter when a registration injects itself
    • Improved Lazy status determination by properly taking into account injected dependencies
  • DIE043: Fixed casting exception

    • Fixed "Unable to cast object of type 'System.Int32' to type 'System.String'" error
    • Improved type handling in dependency graph construction
  • Improved error message for unresolved dependencies

⚡ Performance Improvements (#​136)

  • Cache Refactoring

    • Significant performance improvements through cache refactoring
    • Reduced redundant operations in dependency graph building
  • Graph Build Optimizations

    • Optimization of graph build process to reduce computation time
    • Reduced number of attempts to build a dependency graph
    • Improved metadata analysis with preference for syntactic analysis instead of semantic
  • Variable Management

    • Optimization of Var and VarsMap handling
    • Improved graph build context preparation
    • Enhanced scope persistence rules with helper methods
  • Metadata Analysis

    • Optimized metadata analysis pipeline
    • Reduced overhead in setup metadata detection
  • GraphOverrider

    • Refactored GraphOverrider internals into focused helpers
    • Improved override depth handling
      ... (truncated)

2.3.3

🐞 Bug Fixes

  • #​132 Optional enum default value is emitted as int literal, causing CS1503

Full Changelog: DevTeam/Pure.DI@2.3.2...2.3.3

2.3.2

🚀 New Features

Contributors

@​xchesh
@​NikolayPianikov

2.3.1

This release focuses on simplifying the API, increasing the stability of code generation, and extending support for specific platforms like Unity.

🚀 New Features

  • Simplified Bindings API: Simplified lifetime-specific bindings methods are now available directly, making configurations shorter and more readable (see below).
  • New IConfiguration.SpecialType<T>() API: Allows marking special types (such as Unity base types) to exclude them from automatic simplified bindings and avoid conflicts.

🐞 Bug Fixes

  • Cycle-safe IEnumerable resolution: Improved dependency resolution logic for collections; it now prioritizes non-cyclic dependencies to prevent errors during cross-referencing.
  • Action-based injection scenarios: Added support for scenarios where dependencies are injected via actions, with correct handling of the syntax context.
  • Various fixes in integration tests and benchmarks.

Full Changelog: DevTeam/Pure.DI@2.3.0...2.3.1

Bindings

Bindings are the core mechanism of Pure.DI, used to define how types are created and which contracts they fulfill.

Overview

For Implementations

To bind a contract to a specific implementation:

.Bind<Contract1>(tags).Bind<ContractN>(tags)
    .Tags(tags)
    .As(Lifetime)
    .To<Implementation>()

Alternatively, you can bind multiple contracts at once:

.Bind<Contract1, Contract2>(tags)
    .To<Implementation>()

Example:

.Bind<IService>().To<Service>()

For Factories

To use a custom factory logic via IContext:

.Bind<Contract1>(tags).Bind<ContractN>(tags)
    .Tags(tags)
 ... (truncated)

## 2.3.0

# What’s New in This Release

## Backward Incompatibility

By default, starting with version 2.3.0, no constructors are generated for a composition. The actual set of constructors depends on the composition arguments and lifetime scopes.

### Parameterized constructor (automatic generation)
   
If the composition has any arguments defined, Pure.DI automatically generates a public parameterized constructor that includes all specified arguments.

Example configuration:

```c#
DI.Setup("Composition")
  .Arg<string>("name")
  .Arg<int>("id")
  // ...

Resulting constructor:

public Composition(string name, int id) { /* ... */ }

Important notes:

  • Only arguments that are actually used in the object graph appear in the constructor.
  • Unused arguments are omitted to optimize resource usage.
  • If no arguments are specified, no parameterized constructor is created.

Scope‑related constructors (conditional generation)

If there is at least one binding with Lifetime.Scoped, Pure.DI generates two constructors:

Public default constructor

Used for creating the root scope instance.

public Composition() { /* ... */ }

Internal constructor with parent scope

Used for creating child scope instances. This constructor is internal and accepts a single parameter — the parent scope.

internal Composition(Composition parentScope) { /* ... */ }

... (truncated)

2.2.15

🚀 What's New in This Release

Key Enhancements:

  • Improved examples
  • Improved project templates
    • Including Rider Junie’s guidelines
    • .NET 10 support
  • Reorganized AI-related docs and guidance

Full Changelog: DevTeam/Pure.DI@2.2.14...2.2.15

2.2.14

🚀 What's New in This Release

🐛 Critical Fixes:

  • #​124 Mulitple binding (as attributes) sometimes fail to be properly resolved in a single dependency graph

Full Changelog: DevTeam/Pure.DI@2.2.13...2.2.14

2.2.13

🚀 What's New in This Release

Key Enhancements:

  • Object Lifecycle Optimization

    When working with dependencies, it's important to choose the right object lifetime. For example, if an object with PerResolve is used only once in the entire composition, it's more efficient to apply Transient.

    This provides two key benefits:

    • Reduced system load
    • Elimination of the need for thread synchronization

    This approach allows optimizing application performance and using system resources more efficiently.

    Pure.DI implements this optimization automatically. For exampple, when the Pure.DI detects that an object with PerResolve lifetime is injected only once across the entire object composition, it automatically switches to Transient lifetime. This automation helps developers save time and ensures optimal resource usage without manual intervention. This automatic optimization mechanism is not limited to the PerResolve lifetime. Similar optimizations can be applied to other lifetime management strategies.

    Pure.DI intelligently analyzes the usage patterns and context of each object to determine the most efficient lifetime strategy, ensuring optimal performance across the entire application.

🐛 Critical Fixes:

  • #​123 Overrides do not work with complex expressions

Full Changelog: DevTeam/Pure.DI@2.2.12...2.2.13

2.2.11

🚀 What's New in This Release

NuGet package

Key Enhancements:

  • #​118 ref constructor parameters support, see this example for details
  • #​117 IContext.ConsumerType support, see this example for details

Full Changelog: DevTeam/Pure.DI@2.2.10...2.2.11

2.2.10

🚀 What's New in This Release

NuGet package

🐛 Fixes:

  • #​116 Invalid list of consumer types in IContext.ConsumerTypes

Full Changelog: DevTeam/Pure.DI@2.2.9...2.2.10

2.2.9

🚀 What's New in This Release

NuGet package

🐛 Fixes:

  • Fixes a state synchronization issue within local functions that sometimes occurs
  • Fix formatting of generated code
  • Fix comments for the constructor arguments

Full Changelog: DevTeam/Pure.DI@2.2.8...2.2.9

2.2.8

🚀 What's New in This Release

NuGet package

Key Enhancements:

  • Optimization of object composition
  • Significant reduction in generation time and size of complex compositions

Full Changelog: DevTeam/Pure.DI@2.2.7...2.2.8

2.2.7

🚀 What's New in This Release

NuGet package

Key Enhancements:

– Support for inherited compositions, see this example for details
– #​115 Improve API for using ServiceProviderFactory base class for Microsoft DI integration – remove DependsOn(Base), see this example for details
– Added Enity Framework example

Full Changelog: DevTeam/Pure.DI@2.2.6...2.2.7

2.2.6

🚀 What's New in This Release

NuGet package

Key Enhancements:

  • #​114 Improving the readability of generated code

Full Changelog: DevTeam/Pure.DI@2.2.5...2.2.6

2.2.5

🚀 What's New in This Release

NuGet package

🐛 Critical Fixes:

  • #​113 Incorrect implementation of Double-checked locking

Full Changelog: DevTeam/Pure.DI@2.2.4...2.2.5

2.2.4

🚀 What's New in This Release

NuGet package

🐛 Critical Fixes:

  • #​109 Override not working as expected when resolving an instance from another composition
  • #​110 Incorrectly renames members of local variable types in factories
  • #​111 Incorrectly generates comments for array types

Full Changelog: DevTeam/Pure.DI@2.2.3...2.2.4

2.2.3

🚀 What's New in This Release

NuGet package

🐛 Critical Fixes:

  • #​108 Pure.DI does not work in Unit project when using Builders API

2.2.2

🚀 What's New in This Release

NuGet package

Key Enhancements:

  • Prioritize creating circular dependencies.
  • #​104 Generic BuildUp method, see these examples for details:
  • #​106 DisableAutoBinding Hint
  • #​105 SkipDefaultConstructor hint, for exampe the compiler shows the error Error DIE000 : Unable to resolve for the following code:
interface IBox<out T> { T Content { get; } }

interface ICat { }

class CardboardBox<T> : IBox<T>
{
    public CardboardBox(T content) => Content = content;

    public T Content { get; }

    public override string ToString() => $"[{Content}]";
}

class ShroedingersCat : ICat
{
    public ShroedingersCat() { }
}

static class Setup
{
    private static void SetupComposition()
    {
        DI.Setup("Composition")
            .Hint(Hint.SkipDefaultConstructor, "On")
            .Hint(Hint.SkipDefaultConstructorImplementationTypeNameWildcard, "*.ShroedingersCat")
            .Bind<ICat>().To<ShroedingersCat>()
            .Bind<IBox<TT>>().To<CardboardBox<TT>>()
            .Root<Program>("Root");
    }
}

public class Program
{
    IBox<ICat> _box;

    internal Program(IBox<ICat> box) => _box = box;

 ... (truncated)

## 2.2.1

## 🚀 What's New in This Release

### 🐛 Critical Fixes:
- #​102 Accumulators do not work for the enumerable types

## 2.2.0

## 🚀 What's New in This Release

### Key Enhancements:
- Significant improvements and optimizations in the construction of object composition. Fewer checks, less code, and improved performance. Fixes for complex composition cases and for cases where objects are created on demand.
- #​100 Tag.Any support, please see [this example](https://github.com/DevTeam/Pure.DI/blob/master/readme/tag-any.md) for details

### Backward incompatibility:
Due to significant reworking of object composition creations, the following may have changed:
- sequence of object creation
- number of created objects of the `PerBlock` lifetime
- creation of objects is performed on demand, where previously it happened in advance

### 🐛 Critical Fixes:
- #​99 Use of unassigned local variable
- #​101 ctx.Build Up does not work properly with custom generic type marker

Commits viewable in [compare view](https://github.com/DevTeam/Pure.DI/commits/2.4.3).
</details>

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Pure.DI&package-manager=nuget&previous-version=2.1.72&new-version=2.4.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

---
updated-dependencies:
- dependency-name: Pure.DI
  dependency-version: 2.4.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot @github

dependabot Bot commented on behalf of github Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Labels

The following labels could not be found: automated. Please create it before Dependabot can add it to a pull request.

Please fix the above issues or remove invalid values from dependabot.yml.

@github-actions

Copy link
Copy Markdown

✅ This is a version-update:semver-minor update.

Package: Pure.DI
Update Type: version-update:semver-minor

This PR will be automatically merged once all CI checks pass.

To prevent auto-merge, add the keep-open label or close the PR.

@github-actions

Copy link
Copy Markdown

📊 PR Size Analysis

  • Total Changes: 8 lines
  • Additions: +4 lines
  • Deletions: -4 lines
  • Files Changed: 1
  • Size Label: size/XS

✅ Small PR - should be quick to review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants