Concord.Analyzers
0.24.1
dotnet add package Concord.Analyzers --version 0.24.1
NuGet\Install-Package Concord.Analyzers -Version 0.24.1
<PackageReference Include="Concord.Analyzers" Version="0.24.1" />
<PackageVersion Include="Concord.Analyzers" Version="0.24.1" />
<PackageReference Include="Concord.Analyzers" />
paket add Concord.Analyzers --version 0.24.1
#r "nuget: Concord.Analyzers, 0.24.1"
#:package Concord.Analyzers@0.24.1
#addin nuget:?package=Concord.Analyzers&version=0.24.1
#tool nuget:?package=Concord.Analyzers&version=0.24.1
Concord.Analyzers
Build-time Roslyn analyzers for Concord projects.
Add this package next to Concord.Ref when authoring mods so Concord-specific mistakes can surface in the compiler and IDE instead of at runtime.
<ItemGroup>
<PackageReference Include="Concord.Ref" Version="1.0.0" />
<PackageReference Include="Concord.Analyzers" Version="1.0.0" PrivateAssets="all" />
</ItemGroup>
Analyzer packages are compile-time tooling only. Do not ship them with a mod.
The analyzer package also suppresses C# field-use warnings for [InjectField]
declarations, such as CS0649 for fields that appear unassigned to the compiler
but are supplied by Concord lowering.
For patch declarations whose target can be resolved statically, the analyzer also
checks [InjectField], [InjectProperty], and [InjectMethod] declarations
against the target type. It validates [Inject] target methods and constructors,
overload disambiguation, injection method parameters, ControlHandle<T> return types,
static target usage, duplicate injection declarations, and unsupported declaration
forms such as generic [Inject] methods or invalid [InjectInstance]
properties. It also warns when a plain patch field mirrors a target
field, since that usually means [InjectField] was intended. Injection methods
may return Control only at the head position; a Control return anywhere else
is reported as CONCORD015.
Resolvable targets include [Patch(typeof(Target))], inherited patch targets,
and string targets such as [Patch("Game.Target, GameAssembly")] when that type
is present in the project's source or referenced target assemblies. Unresolvable
string targets produce a warning because Concord cannot validate those declarations
until runtime.
The analyzer also nudges patch declarations toward compiler-checked names when
that is possible: use typeof(Target) instead of a resolvable string patch
target, nameof(Target.Member) instead of a string member target, and an
inherited [Patch] declaration instead of [Patch(typeof(Target))] when the
target class or record can be extended.
Runtime adapters and bootstrap assemblies that can run before the Concord Assembly is loadable can opt into bootstrap-reference checks:
<PropertyGroup>
<ConcordBootstrapAssembly>true</ConcordBootstrapAssembly>
<ConcordBootstrapAdapterAssemblies>MyRuntimeAdapter</ConcordBootstrapAdapterAssemblies>
</PropertyGroup>
<ItemGroup>
<CompilerVisibleProperty Include="ConcordBootstrapAssembly" />
<CompilerVisibleProperty Include="ConcordBootstrapAdapterAssemblies" />
</ItemGroup>
ConcordBootstrapAdapterAssemblies is optional and accepts a semicolon-separated list.
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.24.1 | 43 | 9/20/2026 |
| 0.24.0 | 42 | 9/20/2026 |
| 0.23.1 | 40 | 9/19/2026 |
| 0.23.0 | 38 | 9/19/2026 |
| 0.22.0 | 40 | 9/19/2026 |
| 0.21.1 | 44 | 9/18/2026 |
| 0.21.0 | 39 | 9/18/2026 |
| 0.20.0 | 97 | 9/14/2026 |
| 0.19.2 | 110 | 9/13/2026 |
| 0.19.1 | 98 | 9/12/2026 |
| 0.19.0 | 90 | 9/12/2026 |
| 0.18.0 | 91 | 9/12/2026 |
| 0.17.0 | 113 | 9/10/2026 |
| 0.16.0 | 373 | 9/2/2026 |
| 0.15.0 | 99 | 9/2/2026 |
| 0.14.2 | 117 | 8/29/2026 |
| 0.14.1 | 130 | 8/16/2026 |
| 0.14.0 | 234 | 7/30/2026 |
| 0.13.0 | 110 | 7/28/2026 |
| 0.12.0 | 122 | 7/28/2026 |