You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add startup-time validator for missing peer module dependencies #130
Across one consumer integration, four separate failure modes all came down to "module X is in the assembly graph but its peer module is missing":
Missing peer
Symptom
Admin needs OpenIddict
Startup crash, Body was inferred… (misleading minimal-API error)
Email needs BackgroundJobs
Startup crash, Unable to resolve IBackgroundJobs
Admin/Users/etc. need Localization
Silent — every label renders as bare key (Users.Title, Roles.ColName)
Tenants needs FeatureFlags
Same *.Contracts-only ProjectReference shape
The crash cases are partially addressed by declaring runtime deps as PackageReferences (separate issue). But the silent-fallback cases (Localization missing → bare keys; menu items pointing to nonexistent peer routes) need an actual diagnostic.
Suggested fix
A single boot-time pass that:
Scans [Module]-attributed types for declared dependencies
Inspects endpoint handlers' DI parameter requirements
Inspects shared useTranslation() calls vs TranslationLoader registration
Emits clear diagnostics:
ModuleX endpoint Y requires service Z which is not registered (install module Q)
ModuleX uses translations but SimpleModule.Localization is not installed; UI labels will render as bare keys
Could ship as builder.AddSimpleModule(o => o.ValidateModuleGraph = true) for opt-in until stable.
framework/SimpleModule.Hosting/ModuleGraphValidator.cs runs as an IHostedService on startup, gated by SimpleModuleOptions.ValidateModuleGraph (default true). It scans loaded SimpleModule.*.Contracts assemblies for I*Contracts interfaces and logs a warning for each one that has no registered implementation, naming the missing module package. Skipped in Production to avoid false positives where a downstream app legitimately ships its own implementation of a contract.
Activity
fix: address remaining issues from downstream feedback (#140)
antosubash commentedon Apr 30, 2026
Resolved by #140.
framework/SimpleModule.Hosting/ModuleGraphValidator.csruns as anIHostedServiceon startup, gated bySimpleModuleOptions.ValidateModuleGraph(defaulttrue). It scans loadedSimpleModule.*.Contractsassemblies forI*Contractsinterfaces and logs a warning for each one that has no registered implementation, naming the missing module package. Skipped in Production to avoid false positives where a downstream app legitimately ships its own implementation of a contract.Generated by Claude Code