DecoWeaver 1.0.6.11

dotnet add package DecoWeaver --version 1.0.6.11
                    
NuGet\Install-Package DecoWeaver -Version 1.0.6.11
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DecoWeaver" Version="1.0.6.11" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DecoWeaver" Version="1.0.6.11" />
                    
Directory.Packages.props
<PackageReference Include="DecoWeaver" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DecoWeaver --version 1.0.6.11
                    
#r "nuget: DecoWeaver, 1.0.6.11"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DecoWeaver@1.0.6.11
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DecoWeaver&version=1.0.6.11
                    
Install as a Cake Addin
#tool nuget:?package=DecoWeaver&version=1.0.6.11
                    
Install as a Cake Tool

DecoWeaver

Compile-time decorator registration for .NET dependency injection

NuGet Build Status License: MIT Documentation


DecoWeaver is a .NET incremental source generator that brings compile-time decorator registration to your dependency injection setup. Using C# 11+ interceptors, it automatically wraps your service implementations with decorators at build time—eliminating runtime reflection, assembly scanning, and manual factory wiring.

Why DecoWeaver?

  • Zero runtime overhead - No reflection or assembly scanning at startup
  • 🎯 Type-safe - Catches configuration errors at compile time
  • 🚀 Fast - Incremental generation with Roslyn
  • 🔧 Simple - Class-level or assembly-level decorator attributes
  • 🌐 Flexible - Apply decorators globally or per-implementation
  • 📦 Clean - Generates readable, debuggable interceptor code

📚 View Full Documentation

Installation

Install the NuGet package:

dotnet add package DecoWeaver --prerelease

Ensure your project uses C# 11 or later:

<PropertyGroup>
  <LangVersion>11</LangVersion>
  
</PropertyGroup>

Quick Start

1. Mark your implementation with the decorator to apply

using DecoWeaver.Attributes;

[DecoratedBy<LoggingRepository>]
public class UserRepository : IUserRepository
{
    // Your implementation
}

2. Register your service normally

services.AddScoped<IUserRepository, UserRepository>();

3. That's it!

At compile time, DecoWeaver automatically generates interceptor code that wraps UserRepository with LoggingRepository. When you resolve IUserRepository, you'll get the decorated instance.

LoggingRepository
  └─ UserRepository

For more examples including open generics, multiple decorators, and ordering, see the Quick Start Guide.

Key Features

  • Assembly-Level Decorators: Apply decorators to all implementations from one place with [assembly: DecorateService(...)]
  • Class-Level Decorators: Apply decorators to specific implementations with [DecoratedBy<T>]
  • Keyed Service Support: Works with keyed service registrations like AddKeyedScoped<T, Impl>(serviceKey)
  • Factory Delegate Support: Works with factory registrations like AddScoped<T, Impl>(sp => new Impl(...))
  • Instance Registration Support: Works with singleton instances like AddSingleton<T>(instance)
  • Opt-Out Support: Exclude specific decorators with [DoNotDecorate]
  • Multiple Decorators: Stack multiple decorators with explicit ordering
  • Generic Type Decoration: Decorate generic types like IRepository<T> with open generic decorators
  • Type-Safe: Compile-time validation catches errors early
  • Zero Configuration: No runtime registration or setup needed
  • Debuggable: Generated code is readable and inspectable

Learn more in the Core Concepts documentation.

Requirements

  • C# 11+ (for interceptors support)
  • .NET 8.0+ (for keyed services)
  • .NET SDK 8.0.400+ (Visual Studio 2022 17.11+)

See the Requirements page for full details.

Documentation

📖 Full Documentation - Comprehensive guides and API reference

Key sections:

Contributing

Contributions are welcome! See our Contributing Guide for details.

License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with ⚡ by the LayeredCraft team

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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 Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.6.11 34 3/5/2026
1.0.5-beta.10 436 11/15/2025
1.0.4-beta.9 257 11/14/2025
1.0.3-beta.8 243 11/13/2025
1.0.2-beta.7 250 11/13/2025
1.0.1-beta.6 238 11/10/2025
1.0.0-beta.5 169 11/6/2025
1.0.0-beta.4 163 11/5/2025
1.0.0-beta.3 163 11/5/2025
1.0.0-beta.2 164 11/5/2025
1.0.0-beta.1 163 11/5/2025