Asteroid.DependencyInjection.CompilerTools
0.2.11
dotnet add package Asteroid.DependencyInjection.CompilerTools --version 0.2.11
NuGet\Install-Package Asteroid.DependencyInjection.CompilerTools -Version 0.2.11
<PackageReference Include="Asteroid.DependencyInjection.CompilerTools" Version="0.2.11"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="Asteroid.DependencyInjection.CompilerTools" Version="0.2.11" />
<PackageReference Include="Asteroid.DependencyInjection.CompilerTools"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Asteroid.DependencyInjection.CompilerTools --version 0.2.11
#r "nuget: Asteroid.DependencyInjection.CompilerTools, 0.2.11"
#:package Asteroid.DependencyInjection.CompilerTools@0.2.11
#addin nuget:?package=Asteroid.DependencyInjection.CompilerTools&version=0.2.11
#tool nuget:?package=Asteroid.DependencyInjection.CompilerTools&version=0.2.11
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 导入,不生成共享编译工具二进制文件。
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 |