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

  1. Re-include the application Default feature ('OrchardCore.Application.Default') in the tenant's feature list / Features document.
  2. Restore or regenerate the tenant's feature state file (or recreate the tenant) if it was hand-edited or corrupted.
  3. Check custom IExtensionManager/feature provider implementations for filters that drop the application feature.
  4. 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

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


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)