OrchardCMS/OrchardCore · critical · InvalidOperationException
The 'Default' feature is not registered.
Error message
The 'Default' feature is not registered.
What it means
CompositionStrategy builds a tenant's DI blueprint. Types flagged as 'always composed' must be attributed to the application's Default feature (Application.DefaultFeatureId, typically 'OrchardCore.Application.Default'). If that feature is missing from the shell's allFeatures list, the strategy cannot assign those types and throws InvalidOperationException.
Solutions
- Re-include the application Default feature ('OrchardCore.Application.Default') in the tenant's feature list / Features document.
- Restore or regenerate the tenant's feature state file (or recreate the tenant) if it was hand-edited or corrupted.
- Check custom IExtensionManager/feature provider implementations for filters that drop the application feature.
- Verify the recipe/setup steps don't disable the default application feature.
Example fix
// before // tenants/MyTenant/appsettings Features list omits the app default feature "Features": ["OrchardCore.Contents"] // after "Features": ["OrchardCore.Application.Default", "OrchardCore.Contents"]
Defensive patterns
Strategy: validation
Validate before calling
var features = await _extensionManager.GetFeaturesAsync();
if (!features.Any(f => f.Id == Application.DefaultFeatureId))
_logger.LogCritical("Tenant '{Tenant}' is missing the application default feature", shellSettings.Name); Try / catch
try { var blueprint = await compositionStrategy.ComposeAsync(shellSettings); }
catch (InvalidOperationException ex) when (ex.Message.Contains("feature is not registered"))
{
_logger.LogCritical(ex, "Shell {Name} missing '{DefaultFeature}' — repair the tenant's feature list", shellSettings.Name, Application.DefaultFeatureId);
} Prevention
- Never hand-edit the tenant's Features/appsettings to remove the application default feature.
- Audit recipes and setup steps so they don't disable the default application feature.
- Validate custom IExtensionManager implementations don't filter out the application feature.
- Monitor shell activation logs for missing-feature warnings on tenant startup.
When it happens
Trigger: Calling ComposeAsync when the extension manager/feature list for the shell does not include the application Default feature — e.g., a tenant's enabled-features document was built without it, alwaysComposedTypes exist but the application feature was excluded from discovery.
Common situations: Corrupted or hand-edited tenants/{tenant}/appsettings or Features.json removing the default feature; a recipe or setup step disabling the application default feature; a custom IExtensionManager returning a filtered feature list; brand-new tenant whose application feature registration failed.
Understand the failure class
Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.
Related errors
- A feature is missing a mandatory 'Id' property in the Module
- Could not resolve extension for type
- Could not resolve main feature for type
- Could not resolve features for type
- The type can only be assigned to a single feature. Make…
AI-assisted analysis of OrchardCMS/OrchardCore@4306c0717f (2026-09-13).
Data as JSON: /api/errors/9500c38f20796099.
Report an issue: GitHub.
Appendix: source
Thrown at src/OrchardCore/OrchardCore/Shell/Builders/CompositionStrategy.cs:94
{
continue;
}
var requiredFeatures = RequireFeaturesAttribute.GetRequiredFeatureNamesForType(exportedType);
if (!requiredFeatures.All(x => featureNames.Contains(x)))
{
continue;
}
alwaysComposedTypes.Add(exportedType);
}
}
if (alwaysComposedTypes.Count > 0)
{
var applicationFeature = allFeatures.FirstOrDefault(feature => feature.Id == Application.DefaultFeatureId)
?? throw new InvalidOperationException($"The '{Application.DefaultFeatureId}' feature is not registered.");
foreach (var exportedType in alwaysComposedTypes)
{
entries[exportedType] = [applicationFeature];
}
}
var result = new ShellBlueprint
{
Settings = settings,
Descriptor = descriptor,
Dependencies = entries,
};
if (_logger.IsEnabled(LogLevel.Debug))
{
_logger.LogDebug("Done composing blueprint");
View on GitHub (pinned to 4306c0717f)