{"record":{"id":"9500c38f20796099","repo":"OrchardCMS/OrchardCore","slug":"the-default-feature-is-not-registered","errorCode":null,"errorMessage":"The 'Default' feature is not registered.","messagePattern":"The 'Default' feature is not registered\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"critical","filePath":"src/OrchardCore/OrchardCore/Shell/Builders/CompositionStrategy.cs","lineNumber":94,"sourceCode":"                {\n                    continue;\n                }\n\n                var requiredFeatures = RequireFeaturesAttribute.GetRequiredFeatureNamesForType(exportedType);\n\n                if (!requiredFeatures.All(x => featureNames.Contains(x)))\n                {\n                    continue;\n                }\n\n                alwaysComposedTypes.Add(exportedType);\n            }\n        }\n\n        if (alwaysComposedTypes.Count > 0)\n        {\n            var applicationFeature = allFeatures.FirstOrDefault(feature => feature.Id == Application.DefaultFeatureId)\n                ?? throw new InvalidOperationException($\"The '{Application.DefaultFeatureId}' feature is not registered.\");\n\n            foreach (var exportedType in alwaysComposedTypes)\n            {\n                entries[exportedType] = [applicationFeature];\n            }\n        }\n\n        var result = new ShellBlueprint\n        {\n            Settings = settings,\n            Descriptor = descriptor,\n            Dependencies = entries,\n        };\n\n        if (_logger.IsEnabled(LogLevel.Debug))\n        {\n            _logger.LogDebug(\"Done composing blueprint\");\n","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/OrchardCMS/OrchardCore/blob/4306c0717fe573f6fca1b4955909ddab6a192807/src/OrchardCore/OrchardCore/Shell/Builders/CompositionStrategy.cs#L76-L112","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\n// tenants/MyTenant/appsettings Features list omits the app default feature\n\"Features\": [\"OrchardCore.Contents\"]\n\n// after\n\"Features\": [\"OrchardCore.Application.Default\", \"OrchardCore.Contents\"]","handlingStrategy":"validation","validationCode":"var features = await _extensionManager.GetFeaturesAsync();\nif (!features.Any(f => f.Id == Application.DefaultFeatureId))\n    _logger.LogCritical(\"Tenant '{Tenant}' is missing the application default feature\", shellSettings.Name);","typeGuard":null,"tryCatchPattern":"try { var blueprint = await compositionStrategy.ComposeAsync(shellSettings); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"feature is not registered\"))\n{\n    _logger.LogCritical(ex, \"Shell {Name} missing '{DefaultFeature}' — repair the tenant's feature list\", shellSettings.Name, Application.DefaultFeatureId);\n}","preventionTips":["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."],"tags":["shell","composition","features","multitenancy"],"backgroundTag":"missing-dependency","analyzedSha":"4306c0717fe573f6fca1b4955909ddab6a192807","analyzedAt":"2026-09-13T17:41:05.024Z","contentChangedAt":"2026-09-13T17:41:05.024Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}