Injectable 2.0.0

dotnet add package Injectable --version 2.0.0
                    
NuGet\Install-Package Injectable -Version 2.0.0
                    
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="Injectable" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Injectable" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Injectable" />
                    
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 Injectable --version 2.0.0
                    
#r "nuget: Injectable, 2.0.0"
                    
#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 Injectable@2.0.0
                    
#: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=Injectable&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Injectable&version=2.0.0
                    
Install as a Cake Tool

Injectable

Injectable is a Roslyn source generator that scans your assemblies for injectable types and emits registration metadata for dependency injection containers.

What this package does

  • Targets: netstandard2.0
  • Kind: Analyzer / source generator
  • Discovers: Types annotated with attributes from Injectable.Abstractions
  • Generates: A list of injectable service registrations that you can plug into your DI container

Basic usage

  1. Add a package reference to Injectable and Injectable.Abstractions in your project.
  2. Annotate services you want to be discovered, for example:
using Injectable;

[Injectable]
public class MyService : IMyService { }
  1. Build your project. The generator will emit injectable metadata (e.g. Injectables.g.cs) which you can use to register services in your container.

For more advanced configuration and examples, see the project site or GitHub repository linked from the NuGet page.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.