Asteroid.DependencyInjection.CompilerTools 0.2.9

There is a newer version of this package available.
See the version list below for details.
dotnet add package Asteroid.DependencyInjection.CompilerTools --version 0.2.9
                    
NuGet\Install-Package Asteroid.DependencyInjection.CompilerTools -Version 0.2.9
                    
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="Asteroid.DependencyInjection.CompilerTools" Version="0.2.9">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Asteroid.DependencyInjection.CompilerTools" Version="0.2.9" />
                    
Directory.Packages.props
<PackageReference Include="Asteroid.DependencyInjection.CompilerTools">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
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 Asteroid.DependencyInjection.CompilerTools --version 0.2.9
                    
#r "nuget: Asteroid.DependencyInjection.CompilerTools, 0.2.9"
                    
#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 Asteroid.DependencyInjection.CompilerTools@0.2.9
                    
#: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=Asteroid.DependencyInjection.CompilerTools&version=0.2.9
                    
Install as a Cake Addin
#tool nuget:?package=Asteroid.DependencyInjection.CompilerTools&version=0.2.9
                    
Install as a Cake Tool

Asteroid.DependencyInjection.CompilerTools

本包包含与 Asteroid.DependencyInjection 配套的分析器和成员注入源生成器。

运行时模块引用本包,其 buildTransitive 资产会自动应用于下游项目。消费者应使用 [Injectable] 和 [Inject],不应直接引用本包。

可注入的 partial 类可以实现 partial void OnInjected(ServiceDomain domain),用于初始化 依赖生成器赋值成员的状态。该钩子会在当前继承层声明的成员完成赋值后运行。


This compiler extension is paired exclusively with Asteroid.DependencyInjection. It validates the [Injectable] and [Inject] contracts and generates IServiceInjectable implementations.

The generated implementation resolves mutable reference-typed instance members from the supplied ServiceDomain. Nullable members use optional resolution and non-nullable members use required resolution. Injectable inheritance is implemented by a protected virtual core method so base members are injected before derived members, including across assembly boundaries.

The generator also declares and invokes partial void OnInjected(ServiceDomain domain) for every injectable class. The hook runs after that class has assigned its own injected members. In an inheritance chain, the base hook runs before the derived class assigns its own members. The hook does not imply that an entire circular dependency graph has completed injection.

本项目不生成服务注册、不扫描程序集、不发出模块初始化器,也不支持 keyed、集合、链式或路径注入。 共享 Roslyn 辅助代码以源码形式从 tooling/CompilerTools.Shared 导入,不生成共享编译工具二进制文件。

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has 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
0.2.11 80 11/18/2026
0.2.10 111 10/26/2026
0.2.9 107 10/26/2026
0.2.8 102 10/17/2026
0.2.7 114 10/6/2026
0.2.6 114 9/27/2026
0.2.5 120 9/25/2026
0.2.4 108 9/25/2026
0.2.3 136 9/8/2026
0.2.2 121 9/8/2026
0.2.1 166 9/7/2026
0.2.0 124 8/30/2026
0.1.2 117 8/25/2026
0.1.1 173 8/21/2026
0.1.0 179 8/20/2026