Architecture Decision Record
ADR-106: C# Extension Members as the Public DI Registration Surface
Status
Accepted (2026-09-01; counts re-measured 2026-10-01). Revised 2026-10-06: counts re-measured against current source, and ADC's broker selection is now credited to the framework rather than to an ADC block. Revised 2026-10-07: anchors refreshed after the v1.233.0 release. Revised 2026-10-19: the Helpdesk host examples re-pointed after the host moved to AddMmcaApplicationPipeline. Revised 2026-10-21: counts re-measured (42 DI blocks, 117 extension blocks, 300 baseline lines), the Trade-offs package count made precise (17 packages with a baselined extension surface), and anchors refreshed. Revised 2026-10-26: counts re-measured after the cloud adapter packages landed (46 DI blocks over sixteen packages, 127 extension blocks, 307 shipped baseline lines plus 17 unshipped, 20 packages with a baselined extension surface, 30 CA1708 suppressions), and anchors refreshed. Revised 2026-10-28: the v1.264.0 release promoted every unshipped extension line (326 shipped baseline lines in 20 files, none unshipped), a PWA endpoint block raised the framework count to 128 extension blocks in 107 files, and anchors refreshed. Revised 2026-11-23: Common, Store and ADC compile the blocks under LangVersion 15.0 (only Helpdesk keeps preview in its root props) on an SDK pinned to 11.0.100 with latestFeature roll-forward, so the preview framing is retired; counts re-measured (55 DI blocks over seventeen packages, 154 framework and 42 consumer extension blocks under Source, 396 shipped baseline lines in 24 packages, 40 CA1708 and eleven IDE0051 suppressions), and anchors refreshed.
Context
Every host in this workspace boots the same way: a Program.cs calls a short list of Add* methods
on IServiceCollection, one per layer, and all of the framework's wiring sits behind those names.
MMCA.Helpdesk's web host is the smallest of them, calling
services.AddInfrastructure(builder.Configuration)
(MMCA.Helpdesk/Source/Hosts/MMCA.Helpdesk.Web/Program.cs:78), services.AddAPI(modulesSettings)
(:116) and services.AddMmcaApplicationPipeline(...) (:138), which runs AddApplication()
first and AddApplicationDecorators() last around the host's registration steps. Even that host is
not three calls: its capability opt-ins arrive through the same surface, as
services.AddAuditTrail(builder.Configuration) (:104),
services.AddScheduledJobs(builder.Configuration) (:105),
services.AddMultiTenancy(builder.Configuration) (:106),
services.AddErrorResources<TicketsErrorResources>() (:121) and
s.AddBrokerMessaging(builder.Configuration) inside a pipeline Register step (:156). Every one
of them is an Add* name on IServiceCollection.
What is unusual is how those methods are declared. None of them is a classic static extension method
with a this parameter. Each is a member of a C# extension(T) block: AddApplication is written
as public IServiceCollection AddApplication() inside extension(IServiceCollection services)
(MMCA.Common/Source/Core/MMCA.Common.Application/DependencyInjection.cs:30, method at :36), and
AddInfrastructure
(MMCA.Common/Source/Core/MMCA.Common.Infrastructure/DependencyInjection.cs:50, method at :58),
AddAPI (MMCA.Common/Source/Presentation/MMCA.Common.API/DependencyInjection.cs:28, method at
:45) and AddUIShared (MMCA.Common/Source/Presentation/MMCA.Common.UI/DependencyInjection.cs:37,
method at :43) take the identical shape. The framework says so on the types themselves:
Infrastructure's DI class documents itself as using "C# preview extension types to add methods
directly to IServiceCollection" (Infrastructure/DependencyInjection.cs:41-42) and UI's says it
"Uses C# extension members to add AddUIShared" (UI/DependencyInjection.cs:33).
Compiling that needs a language version that includes extension members, and every repo in the
workspace sets one solution-wide: LangVersion 15.0 in MMCA.Common/Directory.Build.props:18,
MMCA.Store/Directory.Build.props:47 and MMCA.ADC/Directory.Build.props:50, and LangVersion preview in MMCA.Helpdesk/Directory.Build.props:12, each beside the same TreatWarningsAsErrors
(:19, :48, :51, :13). Common multi-targets $(MmcaNetVersions)
(MMCA.Common/Directory.Build.props:7), which is net10.0;net11.0
(MMCA.Common/build/Frameworks.props:23); Store and ADC target $(MmcaNet) (:39, :42, the ADC
net10.0 line selected with -p:MmcaNet=net10.0 per the comment at MMCA.ADC/Directory.Build.props:8)
and Helpdesk targets net10.0 (:9). It is a solution-wide property in a Directory.Build.props
that every project in each repo's solution inherits, not a per-project opt-in. The only projects
that set their own are two MMCA.Common build tools, build/facts/facts.csproj:13 and
build/perfgate/perfgate.csproj:13 (both preview), which sit outside MMCA.Common.slnx, ship no
package, and are deliberately cut off from the root props by MMCA.Common/build/Directory.Build.props:3-7.
This is therefore not a stylistic preference confined to one file. It is the shape of the entire public registration surface of packages published to nuget.org and GitHub Packages under ADR-053, frozen member by member by the ADR-015 public-API gate, and repeated by every consumer that writes its own module registration. A recent language feature sits underneath all of it, and nothing in the code records that as a decision with a stated cost and a stated way out. This record does.
Decision
The framework's public dependency-injection surface is written as C# extension members:
extension(T) blocks inside public static class types, compiled under LangVersion 15.0 in
Common, Store and ADC and LangVersion preview in Helpdesk, and shipped to both registries in that
form. The compiler-emitted classic static extension method is what keeps the choice reversible, and
the public-API baselines record both shapes.
The language version is a workspace-wide property, not a local opt-in. All four repos set
LangVersionin their rootDirectory.Build.props:15.0in Common, Store and ADC (MMCA.Common/Directory.Build.props:18,MMCA.Store/Directory.Build.props:47,MMCA.ADC/Directory.Build.props:50) andpreviewin Helpdesk (MMCA.Helpdesk/Directory.Build.props:12), so every project in every solution compiles at it (the two build-tool projects outsideMMCA.Common.slnxnamed in the Context are the only ones that set their own). The framework's blocks compile under the released15.0, so they do not depend onpreview. All fourglobal.jsonfiles are identical: each pins the SDK to11.0.100withrollForward: latestFeature(MMCA.Common/global.json:2-5) and selects the Microsoft Testing Platform runner (:6-8), so the compiler that interprets these blocks is an 11.0 SDK at feature band 100 or later.Fifty-five
extension(IServiceCollection services)blocks are the DI surface. Measured on 2026-11-23 acrossMMCA.Common/Source, there are 55 such blocks in 55 files, spread over seventeen packages: Application (Application/DependencyInjection.cs:30,Application/DependencyInjection.ModuleScanning.cs:15,Application/DependencyInjection.Crud.cs:16,Application/DependencyInjection.Extensibility.cs:11,Application/DependencyInjection.ProcessManagers.cs:9,Application/DependencyInjection.Webhooks.cs:15,Application/Notifications/DependencyInjection.cs:29), Infrastructure (Infrastructure/DependencyInjection.cs:50,Infrastructure/DependencyInjection.Caching.cs:20,Infrastructure/DependencyInjection.Auth.cs:21,Infrastructure/DependencyInjection.Messaging.cs:17,Infrastructure/DependencyInjection.Jobs.cs:15,Infrastructure/DependencyInjection.Notifications.cs:18,Infrastructure/DependencyInjection.Persistence.cs:10,Infrastructure/DependencyInjection.FeatureFlags.cs:15,Infrastructure/DependencyInjection.MachineClients.cs:13,Infrastructure/Webhooks/WebhookServiceCollectionExtensions.cs:21), Passkeys (Passkeys/PasskeysServiceCollectionExtensions.cs:12), AI (AI/DependencyInjection.cs:79,AI/Guardrails/GuardrailServiceCollectionExtensions.cs:19), AI.OpenAI (AI.OpenAI/DependencyInjection.cs:19), AI.Anthropic (AI.Anthropic/DependencyInjection.cs:19), API (API/DependencyInjection.cs:28,API/Authentication/ExternalAuthExtensions.cs:38,API/Authorization/AuthorizationExtensions.cs:21,API/Caching/OutputCacheEvictionExtensions.cs:95,API/Startup/MiniProfilerExtensions.cs:11,API/Startup/WebApplicationBuilderExtensions.cs:32,API/Startup/WebApplicationBuilderExtensions.Authentication.cs:27,API/Startup/WebApplicationBuilderExtensions.RateLimiting.cs:357), UI (UI/DependencyInjection.cs:37,UI/Notifications/DependencyInjection.cs:14,UI/Services/Capabilities/DependencyInjection.cs:26,UI/Services/Diagnostics/DependencyInjection.cs:14,UI/TwoFactor/DependencyInjection.cs:15), UI.Web (UI.Web/DependencyInjection.cs:22,UI.Web/Hardening/BlazorCircuitLimitExtensions.cs:43,UI.Web/Hardening/UiRateLimitingExtensions.cs:208,UI.Web/SameOriginProxy/SameOriginApiProxyServiceExtensions.cs:39), UI.Maui (UI.Maui/DependencyInjection.cs:37), Grpc (Grpc/DependencyInjection.cs:28,Grpc/Authentication/ServiceTokenServiceCollectionExtensions.cs:25), Aspire (Aspire/Extensions.cs:144,Aspire/GatewayCorsExtensions.cs:18,Aspire/Security/SecurityHeaders.cs:260,Aspire/Gateway/GatewayRateLimitingExtensions.cs:360,Aspire/Gateway/GatewayHealthCheckExtensions.cs:97), Gateway (Gateway/RateLimiting/GatewayRoutePolicyExtensions.cs:51), Testing (Testing/Support/FeatureManagementTestExtensions.cs:12,Testing/Support/RateLimiterTestExtensions.cs:13,Testing/Support/ServiceCollectionFakeExtensions.cs:11,Testing/Fixtures/CrossServiceHostIsolation.cs:32) and the three cloud vendor adapters, Azure (Azure/AzureServiceCollectionExtensions.cs:33), Aws (Aws/AwsServiceCollectionExtensions.cs:32) and Gcp (Gcp/GcpServiceCollectionExtensions.cs:29). A plain text search finds 59 occurrences of that exact receiver, because four of them are analyzer-suppression justification strings rather than declarations (Infrastructure/DependencyInjection.Messaging.cs:187,:240,:263,Infrastructure/DependencyInjection.Jobs.cs:145).The idiom reaches well past DI. Re-measured on 2026-11-23, an anchored search finds 154
extensionblocks across 128 files underMMCA.Common/Source, generic receivers included. Receivers includeWebApplicationBuilder(API/Startup/ModuleHostExtensions.cs:24,Aspire/Logging/SerilogHostExtensions.cs:29),WebApplication(API/Startup/WebApplicationExtensions.cs:38),IEndpointRouteBuilder(API/Startup/Endpoints/JwksEndpointExtensions.cs:22,API/SessionCookies/SessionCookieEndpoints.cs:21),IApplicationBuilder(Gateway/ForwardedHeadersExtensions.cs:25),IDistributedApplicationBuilder(Aspire.Hosting/Extensions.cs:179), a genericIResourceBuilder<TResource>(:300) andIResourceBuilder<DotnetProjectResource>(:400,:473,:523),IPageandILocator(Testing.E2E/Infrastructure/PageExtensions.cs:81,:429),Assembly,TypeandPropertyInfo(Testing.Architecture/RuleHelpers.cs:16,:48,:122), and generic receivers such asIReadRepository<TEntity, TIdentifierType>(Application/Extensions/ReadRepositoryExtensions.cs:12).Module composition is registered through one of these blocks.
AddModuleHostbinds the two settings sections, builds theModuleLoaderand registers it as a singleton, and it is an extension member onWebApplicationBuilder(API/Startup/ModuleHostExtensions.cs:24, method at:51). TheIModulecontract of ADR-059 therefore reaches a host through the same surface this record describes.Consumers write them too. The idiom is not confined to the framework: MMCA.ADC declares 20 blocks across 20 files under
Source(14 module DI classes, the four service-contract packages,Modules/Conference/MMCA.ADC.Conference.API/Authorization/CurrentUserServiceExtensions.csandServices/MMCA.ADC.Identity.Service/Authorization/TokenPermissionGrants.cs; the web-host hardening registrations live in the framework atUI.Web/Hardening/BlazorCircuitLimitExtensions.cs:43andUI.Web/Hardening/UiRateLimitingExtensions.cs:208, and broker selection inAspire.Hosting/BrokerSelection.cs), MMCA.Store 19 across 19, and MMCA.Helpdesk 3 across 3 (Helpdesk/Source/Modules/Tickets/MMCA.Helpdesk.Tickets.Application/DependencyInjection.csand its.APIand.Infrastructuresiblings). The reference seed teaches the shape by using it.The call site is indistinguishable from a classic extension method. A host writes
services.AddInfrastructure(builder.Configuration);(Helpdesk/Source/Hosts/MMCA.Helpdesk.Web/Program.cs:78), and the same holds for every other entry point. Nothing about the declaration style is visible to the caller.The public-API gate records every extension member twice. RS0016 and RS0017 stay at error severity (
MMCA.Common/Directory.Build.props:38) and every packable Source project declares its surface inPublicAPI.Shipped.txt(gate comment atMMCA.Common/Directory.Build.props:138-147, rules described at:140-141, gate item group at:148). For an extension member the baseline holds a container line plus a member line, and a separate classic static line carrying athisparameter.AddApplicationappears asMMCA.Common.Application.DependencyInjection.extension(...IServiceCollection!).AddApplication()(Application/PublicAPI.Shipped.txt:517, container at:516) and asstatic MMCA.Common.Application.DependencyInjection.AddApplication(this ...IServiceCollection! services)(:1927). Across the repo there are 396.extensionlines in 24PublicAPI.Shipped.txtfiles and none in anyPublicAPI.Unshipped.txtfile, so 24 packages carry a baselined extension surface, all of it shipped. Gateway's surface is shipped like the rest: both shapes ofUseCommonForwardedHeaderssit inGateway/PublicAPI.Shipped.txt:12and:108, and itsPublicAPI.Unshipped.txtis a single line.One extension property exists in the whole surface, and it emits a different classic shape.
IsIdValueGeneratedis declared as an extension property onType(Domain/Extensions/EntityTypeExtensions.cs:11) and is recorded as...EntityTypeExtensions.extension(System.Type!).IsIdValueGenerated.get -> bool(Domain/PublicAPI.Shipped.txt:180) with the classic counterpartstatic ...EntityTypeExtensions.get_IsIdValueGenerated(System.Type! entityType) -> bool(:465). A method emitsName(this T x); a property emitsget_Name(T x). Those are different members.The MAUI package uses the idiom but sits outside the gate.
MMCA.Common.UI.Mauideclares three blocks (UI.Maui/DependencyInjection.cs:37onIServiceCollection,UI.Maui/HostingDependencyInjection.cs:17onMauiAppBuilder,UI.Maui/WindowLifecycleExtensions.cs:24onWindow) and is the one project excluded from the public-API analyzer, because it lives outsideMMCA.Common.slnxand builds only on the windows MAUI job (MMCA.Common/Directory.Build.props:148, reason at:144-146, naming ADR-042). Its extension surface is therefore unbaselined.Analyzer fallout is carried as documented suppressions, not by changing the code shape. CA1708 ("identifiers should differ by more than case") fires on the compiler-generated grouping members of an
extension(T)block and is suppressed at the type with an explicit false-positive justification in 40 files, 39 of them underMMCA.Common/Source(for exampleGateway/ForwardedHeadersExtensions.cs:19-22,UI/Extensions/MoneyExtensions.cs:10-13) and one in an ADC E2E page object (MMCA.ADC/Tests/E2E/MMCA.ADC.E2E.Tests/PageObjects/Conference/Events/EventFilterPageExtensions.cs:12). IDE0051 ("unused private member") misses references that cross from inside a block to a private member of the containing class, which the justifications record against SDK 10.0.201 and later, and is suppressed by elevenSuppressMessageattributes across three files with that reason spelled out (Infrastructure/DependencyInjection.Jobs.cs:144,Infrastructure/DependencyInjection.Messaging.cs:186,:239,:262,Testing.E2E/Infrastructure/PageExtensions.cs:22at type level,:548,:565,:580,:606,:625and:641).Shared/Extensions/DomainHelper.cscarries no IDE0051 suppression; plain comments name the calling block member (:77,:106).A fitness function has to know the emitted shape. The
DomainThrowsOnlyArgumentGuardsrule (Testing.Architecture/Rules/Domain/ArchitectureRules.DomainThrows.cs:71) walks IL and would otherwise flag the skeleton members anextension(T)block leaves in a Domain assembly, whoseNotSupportedExceptionnobody typed. It skips any method carryingSystem.Runtime.CompilerServices.ExtensionMarkerAttribute(constant at:8, filter at:92, predicate at:184-187with the marker clause at:185, documented at:166-183). The same predicate also skips explicit interface implementations on compiler-generated types, the other body shape no developer wrote.The exit path is a mechanical rewrite that does not reach callers. If the feature changed shape, each block would be flattened back to classic static extension methods: a
public R M(...)insideextension(T x)becomespublic static R M(this T x, ...), with the method names, parameters and return types unchanged. That is exactly the form the baselines already record on theirstatic ...(this ...)lines (Application/PublicAPI.Shipped.txt:1927-1942), so the public API a consumer binds to would not move and noProgram.csline would change. The single exception is the extension property in Decision point 8, whose classic form isget_IsIdValueGenerated(Type)rather than athis-marked method.
Rationale
- One
Add*name per layer is the point of the surface. A host reads as a list of layers (Program.cs:78,:116,:138), and grouping the registrations by receiver in a single block is what keeps the declaration site organized by what it extends rather than by a repeatedthis IServiceCollection servicesparameter on every method. - The compiler already emits the classic shape, so the exposure is small. Both forms are in the baseline for every extension member, which is direct evidence that the shipped metadata still contains an ordinary static extension method. The choice is about a declaration syntax, not about a new binding mechanism reaching consumers.
- The public-API gate turns that into a reviewable diff. RS0016 and RS0017 at error severity
(
Directory.Build.props:38) mean any change to an extension member, including one caused by a compiler change to the emitted shape, shows up as a text diff inPublicAPI.Shipped.txtbefore a package is published, which is the same protection ADR-015 gives every other member. - Consistency across four repos beats a mixed idiom. With 154 blocks in the framework and 42 more
under the
Sourcetrees of ADC, Store and Helpdesk (plus one in an ADC E2E page object), a partial adoption would mean a reader has to know which of two declaration styles a givenAdd*uses. The property is set once per repo inDirectory.Build.propsand the shape is uniform. - The suppressions are cheaper than the alternative. Forty type-level CA1708 suppressions and
eleven IDE0051 ones are a bounded, documented cost. The alternative under
TreatWarningsAsErrorsplusCodeAnalysisTreatWarningsAsErrors(Directory.Build.props:19,:25) would be lowering an analyzer's severity repo-wide, which hides real hits along with the false ones.
Trade-offs
- A recent language feature under a rolling SDK is a moving target. Every
global.jsonpins SDK11.0.100withrollForward: latestFeature(MMCA.Common/global.json:2-5), and CI installs both10.0.xand11.0.x(MMCA.Common/.github/workflows/ci.yml:121-123and thirteen more,release.yml:57,:272, with11.0.xalone at:165and:373, andload-tests.yml:46), so the compiler and the analyzers that interpret these blocks can move to any later 11.0 feature band or patch with no repo edit. Helpdesk compiles underpreview, whose meaning moves with the SDK as well. That is not hypothetical: the IDE0051 suppressions record behavior that differs between SDK 10.0.201 and the 10.0.104 the same comment names (Infrastructure/DependencyInjection.Messaging.cs:187). - Method to property inside a block is a binary break, and it does not look like one. Both are
members of the same block and the source edit is two words, but the emitted classic member changes
from
Name(this T)toget_Name(T)(Domain/PublicAPI.Shipped.txt:180beside:465, againstApplication/PublicAPI.Shipped.txt:517beside:1927). RS0017 catches the removal at build time in MMCA.Common; a consumer that had already compiled against the old member does not get that warning. - Analyzers do not fully understand the shape. CA1708 is wrong on every block it flags (40 type-level suppressions) and IDE0051 is wrong across the block boundary (eleven more). Each suppression is a place where a genuine future hit on that type is silenced too, and the IDE0051 ones carry an explicit "remove this once Roslyn fixes it" that nothing enforces.
- Anything reflecting over the assemblies has to special-case the marker attribute. The
architecture fitness rule already does
(
Testing.Architecture/Rules/Domain/ArchitectureRules.DomainThrows.cs:8,:184-187). Any future rule, source generator or documentation tool that walks methods in a framework assembly inherits the same requirement, and the failure mode is a false positive on a body no developer wrote. - The public-API baselines are roughly doubled for this surface. 396 shipped
.extensionlines sit alongside theirstatic ...(this ...)counterparts, so a single new registration method costs two or three baseline lines instead of one, and a reviewer reading a baseline diff sees the same member twice. - The one package with no gate is the one with the least coverage.
MMCA.Common.UI.Maui's three blocks (UI.Maui/DependencyInjection.cs:37,UI.Maui/HostingDependencyInjection.cs:17,UI.Maui/WindowLifecycleExtensions.cs:24) are excluded from RS0016/RS0017 (Directory.Build.props:148), so a reshape there would reach a published package without the text diff that protects the 24 packages whose extension surface is baselined. - The declaration reads as an instance method that is not one.
public IServiceCollection AddApplication()(Application/DependencyInjection.cs:36) has no visible receiver parameter; the receiver comes from the enclosing block header six lines up. That is the ergonomic benefit and the readability cost in the same line, and it is why eleven suppression justifications and two inline comments had to explain the block boundary in prose rather than point at a rule (Infrastructure/DependencyInjection.Jobs.cs:145,Infrastructure/DependencyInjection.Messaging.cs:187,:240,:263,Testing.E2E/Infrastructure/PageExtensions.cs:23,:549,:566,:581,:607,:626,:642,Shared/Extensions/DomainHelper.cs:77,:106).
Revision (2026-10-01)
No decision or rationale changed: the framework's DI surface is still written as extension(T)
blocks compiled under LangVersion preview, and both emitted shapes are still baselined. The
counts and citations were re-measured against MMCA.Common v1.216.0. The Application and
Infrastructure DI classes are now split into partial files, so the extension(IServiceCollection services) blocks number 39 over thirteen packages (adding AI.OpenAI/DependencyInjection.cs:19
and AI.Anthropic/DependencyInjection.cs:19), and the four IDE0051 justification strings moved to
Infrastructure/DependencyInjection.Messaging.cs:195, :218, :257 and
Infrastructure/DependencyInjection.Jobs.cs:145. The ADC web-host hardening registrations moved
into the framework (UI.Web/Hardening/BlazorCircuitLimitExtensions.cs:43,
UI.Web/Hardening/UiRateLimitingExtensions.cs:150), so ADC now declares 21 blocks in 21 files and
the framework 107 in 88. Every .extension baseline line is shipped (279 in 17
PublicAPI.Shipped.txt files, none unshipped), including Gateway's
(Gateway/PublicAPI.Shipped.txt:12, :98). UI.Maui gained a third block
(UI.Maui/WindowLifecycleExtensions.cs:24), CA1708 is suppressed in 26 files and IDE0051 in eight
places across four files, and the line anchors for Directory.Build.props in Store and Helpdesk,
the public-API baselines, the DomainThrowsOnlyArgumentGuards rule and the CI workflows were
refreshed.
Revision (2026-10-06)
No decision or rationale changed; the counts and one attribution were corrected against current source.
- The
extension(IServiceCollection services)blocks number 41 in 41 files (still thirteen packages), addingUI.Web/SameOriginProxy/SameOriginApiProxyServiceExtensions.cs:39andTesting/Fixtures/CrossServiceHostIsolation.cs:32; a text search finds 45 hits, the four extra being the justification strings now atInfrastructure/DependencyInjection.Messaging.cs:201,:224,:263andInfrastructure/DependencyInjection.Jobs.cs:145. - The framework declares 112
extensionblocks in 92 files (the count includes generic-receiver blocks). - ADC declares 20 blocks in 20 files:
AppHost/BrokerSelection.csis gone from ADC and broker selection lives in the framework atAspire.Hosting/BrokerSelection.cs. Store declares 18 in 18; Helpdesk is unchanged at 3, so consumers add 41. - The shipped baselines hold 290
.extensionlines in 17 files, still none unshipped. - CA1708 is suppressed in 27 files (26 in MMCA.Common, one in ADC). IDE0051 is suppressed in nine places
across four files: seven attributes (a third in
Testing.E2E/Infrastructure/PageExtensions.csat:496) and the two#pragmapairs. - Every remaining line anchor in Context, Decision, Rationale and Trade-offs was re-verified against current source and moved where the code moved.
Revision (2026-10-07)
Re-verified against current source. No decision, rationale, count or trade-off changed: the DI surface
is still written as extension(T) blocks under LangVersion preview and both emitted shapes are still
baselined. Only line anchors moved after the v1.233.0 release.
- Anchors re-verified against current source: the
AddApplicationextension member is atMMCA.Common/Source/Core/MMCA.Common.Application/PublicAPI.Shipped.txt:260(container at:259) and its classic static form at:1241, so the classicDependencyInjectionblock runs:1241-1253(ending atVerifyDecoratorPipeline);dotnet-version: '10.0.x'inMMCA.Common/.github/workflows/release.ymlis at:50and:186.
Revision (2026-10-19)
Re-verified against current source. No decision, rationale, count or trade-off changed; the Helpdesk
host the Context and Decision use as their example composes through AddMmcaApplicationPipeline.
MMCA.Helpdesk/Source/Hosts/MMCA.Helpdesk.Web/Program.csno longer callsservices.AddApplication()orservices.AddApplicationDecorators()directly: both run insideservices.AddMmcaApplicationPipeline(...)(:121). The Context listsAddInfrastructure(:77),AddAPI(:99) and the pipeline call (:121) instead, with the opt-ins at:88,:89,:90,:104and the broker registration as aRegisterstep at:139; Decision point 6 uses theAddInfrastructurecall site (:77) as its plain-extension example.
Revision (2026-10-21)
Re-verified against current source. No decision, rationale or trade-off changed: the DI surface is
still written as extension(T) blocks under LangVersion preview and both emitted shapes are still
baselined. Three counts grew, one count in Trade-offs was made precise, and several anchors moved.
- The
extension(IServiceCollection services)blocks number 42 in 42 files (still thirteen packages), addingGrpc/Authentication/ServiceTokenServiceCollectionExtensions.cs:25; a plain text search finds 46 hits, the four extra still being the justification strings atInfrastructure/DependencyInjection.Messaging.cs:201,:224,:263andInfrastructure/DependencyInjection.Jobs.cs:145. - The framework declares 117
extensionblocks in 96 files underMMCA.Common/Source(anchored search, generic receivers included).Aspire.Hosting/Extensions.csholds five of them (:138,:253,:352,:422,:457). - The shipped baselines hold 300
.extensionlines (generic.extension<T>(lines included) in 17PublicAPI.Shipped.txtfiles, still none unshipped. - Trade-offs named "the other eighteen" projects behind the public-API gate. 21 Source projects
carry a
PublicAPI.Shipped.txtand are gated (every packable project exceptMMCA.Common.UI.Maui,Directory.Build.props:111), and 18 of them declare extension blocks, but the blocks inTesting.Architectureare internal (Testing.Architecture/RuleHelpers.cs:14), so the text diff protects 17 packages: the same 17PublicAPI.Shipped.txtfiles that hold the 300.extensionlines in item 3. The text now names those 17 packages. IsCompilerSynthesizedinTesting.Architecture/Rules/Domain/ArchitectureRules.DomainThrows.cs:184-187now also skips explicit interface implementations on compiler-generated types; theExtensionMarkerAttributeclause (:185) is unchanged.- Anchors re-verified against current source:
UI/DependencyInjection.cs:34(block),:40(AddUIShared),:30(doc line);Aspire/Extensions.cs:115; the Helpdesk layer calls the Rationale cites atMMCA.Helpdesk/Source/Hosts/MMCA.Helpdesk.Web/Program.cs:77,:99,:121;MMCA.Common/Directory.Build.props:101-118(gate block, rules at:103-104, item group and UI.Maui exclusion at:111, reason at:107-109);Application/PublicAPI.Shipped.txt:1239(classicAddApplication, block:1239-1251ending atVerifyDecoratorPipeline);Domain/PublicAPI.Shipped.txt:113and:296; theDomainThrowsdoc comment at:166-183;dotnet-version: '10.0.x'inMMCA.Common/.github/workflows/release.ymlat:50and:188(the 2026-10-07 entry's:186is superseded), plusload-tests.yml:44.
Revision (2026-10-26)
Re-verified against current source. No decision or rationale changed: the DI surface is still written
as extension(T) blocks under LangVersion preview and both emitted shapes are still baselined. The
cloud vendor adapter packages (Azure, Aws, Gcp) and a persistence partial grew the framework counts
(the consumer block total and the IDE0051 count are unchanged), the
public-API baselines now hold unshipped extension lines, and several anchors moved.
- The
extension(IServiceCollection services)blocks number 46 in 46 files over sixteen packages, addingInfrastructure/DependencyInjection.Persistence.cs:10,Azure/AzureServiceCollectionExtensions.cs:30,Aws/AwsServiceCollectionExtensions.cs:31andGcp/GcpServiceCollectionExtensions.cs:28; a plain text search finds 50 hits, the four extra still being the justification strings, now atInfrastructure/DependencyInjection.Messaging.cs:187,:240,:263andInfrastructure/DependencyInjection.Jobs.cs:145. - The framework declares 127
extensionblocks in 106 files underMMCA.Common/Source(anchored search, generic receivers included); the consumer total of 41 is unchanged, so the Rationale reads 127 plus 41. - The baselines hold 307
.extensionlines in 19PublicAPI.Shipped.txtfiles and 17 inPublicAPI.Unshipped.txtfiles (Gcp10,Aws6,Infrastructure1), so "none unshipped" no longer holds. 25 Source projects now carry aPublicAPI.Shipped.txt, and 20 packages have a baselined extension surface (the 19 shipped files plus Gcp, whose extension lines are all unshipped); Trade-offs names 20. - CA1708 is suppressed in 30 files: 29 under
MMCA.Common/Source(the new ones include the Azure, Aws and Gcp service-collection extensions) and one in ADC (MMCA.ADC/Tests/E2E/MMCA.ADC.E2E.Tests/PageObjects/Conference/Events/EventFilterPageExtensions.cs:12); Store and Helpdesk have none. IDE0051 is still suppressed nine times across four files. - Anchors re-verified against current source:
Infrastructure/DependencyInjection.Messaging.cs:17(block),:186,:239,:262(IDE0051 attributes);Infrastructure/DependencyInjection.Notifications.cs:16;API/Startup/WebApplicationBuilderExtensions.RateLimiting.cs:342;UI.Web/Hardening/UiRateLimitingExtensions.cs:188;Grpc/DependencyInjection.cs:28;Aspire/Extensions.cs:136(the 2026-10-21 entry's:115is superseded);Aspire/Gateway/GatewayRateLimitingExtensions.cs:281;API/Startup/WebApplicationExtensions.cs:38;Aspire.Hosting/Extensions.cs:138,:353,:423,:458;MMCA.Common/Directory.Build.props:84-101(gate comment and item group, rules described at:86-87, UI.Maui exclusion at:94, reason at:90-92);Application/PublicAPI.Shipped.txt:1240(classicAddApplication, block:1240-1252ending atVerifyDecoratorPipeline);Domain/PublicAPI.Shipped.txt:115and:298; the 10.0.104 citation in Trade-offs atInfrastructure/DependencyInjection.Messaging.cs:187; anddotnet-version: '10.0.x'atMMCA.Common/.github/workflows/ci.yml:101plus twelve more.
Revision (2026-10-28)
Re-verified against current source. No decision, rationale or trade-off changed: the DI surface is
still written as extension(T) blocks under LangVersion preview and both emitted shapes are still
baselined. The 46 extension(IServiceCollection services) blocks, the consumer total of 41 (ADC 20,
Store 18, Helpdesk 3) and the CA1708 and IDE0051 counts are unchanged; the v1.264.0 release moved the
baselines and added one framework block.
- The framework declares 128
extensionblocks in 107 files underMMCA.Common/Source(anchored search, generic receivers included). The new one isUI.Web/Pwa/ServiceWorkerEndpointExtensions.cs:32, onIEndpointRouteBuilder, so the DI count does not move; the Rationale reads 128 plus 41. - The release promoted every unshipped baseline line: the baselines hold 326
.extensionlines in 20PublicAPI.Shipped.txtfiles (API70 the largest;Gcp10,Aws9,Azure10,Infrastructure30), and everyPublicAPI.Unshipped.txtholds only#nullable enable(Gcp/PublicAPI.Unshipped.txt:1). The 2026-10-26 entry's "17 unshipped" and "Gcp's is unshipped only" no longer hold; the 20 packages with a baselined extension surface are now all shipped. Gateway's shapes stay atGateway/PublicAPI.Shipped.txt:12and:98. - Anchors re-verified against current source:
Application/PublicAPI.Shipped.txt:260(container at:259) and the classic staticAddApplicationat:1246, so the classic block runs:1246-1258ending atVerifyDecoratorPipeline(the 2026-10-26 entry's:1240-1252is superseded).
Revision (2026-11-23)
Re-verified against current source. The decision stands: the framework's DI surface is still
written as extension(T) blocks and both emitted shapes are still baselined. What moved is the
language and SDK footing under it, which the Context, the Decision headline, Decision point 1, the
Rationale and the first Trade-off described as preview on a floating 10.0.x SDK, and every count.
- Common, Store and ADC now compile under
LangVersion 15.0(MMCA.Common/Directory.Build.props:18,MMCA.Store/Directory.Build.props:47,MMCA.ADC/Directory.Build.props:50); only Helpdesk keepspreviewin its root props (MMCA.Helpdesk/Directory.Build.props:12), and the two MMCA.Common build tools outside the solution (build/facts/facts.csproj:13,build/perfgate/perfgate.csproj:13) setpreviewon their own behindMMCA.Common/build/Directory.Build.props:3-7. The framework's blocks therefore compile under a released language version, and "compiling that requires a preview language version" no longer holds. The live text now names the version per repo. - All four
global.jsonfiles now pin SDK11.0.100withrollForward: latestFeature(MMCA.Common/global.json:2-5) beside the Microsoft Testing Platform runner (:6-8), and CI installs10.0.xand11.0.xtogether (MMCA.Common/.github/workflows/ci.yml:121-123, fourteen sites in all;release.yml:57,:272, plus11.0.xalone at:165,:373;load-tests.yml:46). The first Trade-off now describes a pinned feature band that rolls forward within 11.0, not an unpinned 10.0.x SDK. - Common multi-targets
$(MmcaNetVersions)(MMCA.Common/Directory.Build.props:7,net10.0;net11.0atMMCA.Common/build/Frameworks.props:23), and Store and ADC target$(MmcaNet)(MMCA.Store/Directory.Build.props:39,MMCA.ADC/Directory.Build.props:42); the Context no longer says every repo shares onenet10.0target. - The
extension(IServiceCollection services)blocks number 55 in 55 files over seventeen packages (Passkeys added), the new ones beingApplication/DependencyInjection.ProcessManagers.cs:9,Application/DependencyInjection.Webhooks.cs:15,Infrastructure/DependencyInjection.FeatureFlags.cs:15,Infrastructure/DependencyInjection.MachineClients.cs:13,Infrastructure/Webhooks/WebhookServiceCollectionExtensions.cs:21,Passkeys/PasskeysServiceCollectionExtensions.cs:12,Testing/Support/ServiceCollectionFakeExtensions.cs:11,UI/Services/Diagnostics/DependencyInjection.cs:14andUI/TwoFactor/DependencyInjection.cs:15; a plain text search finds 59 hits, the four extra still being the justification strings. - The framework declares 154
extensionblocks in 128 files underMMCA.Common/Source(anchored search, generic receivers included).Aspire.Hosting/Extensions.csholds five, now onIDistributedApplicationBuilder(:179), a genericIResourceBuilder<TResource>(:300) andIResourceBuilder<DotnetProjectResource>(:400,:473,:523) rather thanIResourceBuilder<ProjectResource>. - Consumers declare 42 blocks under
Source(ADC'sTeststree adds one more, inEventFilterPageExtensions.cs:34): ADC 20 and Helpdesk 3 unchanged, Store 19 in 19 (up from 18). The Rationale reads 154 plus 42. - The baselines hold 396
.extensionlines in 24PublicAPI.Shipped.txtfiles (API72 the largest; Passkeys, ServiceHost, Azure.Startup and Mcp newly baselined), still none unshipped, so 24 packages carry a baselined extension surface. - CA1708 is suppressed in 40 files: 39 under
MMCA.Common/Sourceand the same one in ADC; Store and Helpdesk have none. IDE0051 is suppressed by elevenSuppressMessageattributes across three files (seven inTesting.E2E/Infrastructure/PageExtensions.cs);Shared/Extensions/DomainHelper.csno longer carries#pragmasuppressions, only plain comments at:77and:106. - UI's DI class no longer repeats the "preview" wording: it says "Uses C# extension members"
(
UI/DependencyInjection.cs:33). Infrastructure's still says "C# preview extension types" (Infrastructure/DependencyInjection.cs:41-42). - Anchors re-verified against current source: the Helpdesk host at
MMCA.Helpdesk/Source/Hosts/MMCA.Helpdesk.Web/Program.cs:78,:104,:105,:106,:116,:121,:138,:156;Application/DependencyInjection.cs:30(method:36);Infrastructure/DependencyInjection.cs:50(method:58);UI/DependencyInjection.cs:37(method:43);Infrastructure/DependencyInjection.Auth.cs:21,.Caching.cs:20,.Notifications.cs:18;API/Authentication/ExternalAuthExtensions.cs:38;API/Authorization/AuthorizationExtensions.cs:21;API/Startup/WebApplicationBuilderExtensions.RateLimiting.cs:357;UI/Services/Capabilities/DependencyInjection.cs:26;UI.Web/Hardening/UiRateLimitingExtensions.cs:208;UI.Maui/DependencyInjection.cs:37;Aspire/Extensions.cs:144;Aspire/Gateway/GatewayRateLimitingExtensions.cs:360;Gateway/RateLimiting/GatewayRoutePolicyExtensions.cs:51;Azure/AzureServiceCollectionExtensions.cs:33,Aws/AwsServiceCollectionExtensions.cs:32,Gcp/GcpServiceCollectionExtensions.cs:29;Testing.E2E/Infrastructure/PageExtensions.cs:81and:429;MMCA.Common/Directory.Build.props:138-147(gate comment, rules at:140-141, UI.Maui reason at:144-146),:148(item group and UI.Maui exclusion),:38(RS0016/RS0017 stay at error),:19and:25(the two warnings-as-errors switches);Application/PublicAPI.Shipped.txt:517(container:516) and the classicAddApplicationat:1927, so the classic block runs:1927-1942ending atVerifyDecoratorPipeline;Gateway/PublicAPI.Shipped.txt:12and:108;Domain/PublicAPI.Shipped.txt:180and:465.
Related
ADR-015 (the RS0016/RS0017 baseline that freezes both
emitted shapes of every extension member, and the fitness-rule tier that had to learn about
ExtensionMarkerAttribute), ADR-059 (the IModule
contract, whose host-side composition is registered through the AddModuleHost extension member),
ADR-053 (the dual-registry publish that ships this surface
to nuget.org and GitHub Packages), ADR-016 (lockstep
versioning: a reshape of this surface lands in every package at one version and every consumer bumps
in one pass), ADR-042 (the MAUI record named by the
Directory.Build.props exclusion that leaves MMCA.Common.UI.Maui outside the public-API gate),
ADR-101 (the metapackage a host installs to get most of these Add*
names in one PackageReference).