OrchardCMS/OrchardCore · error · InvalidOperationException
Unsupported setting
Error message
Unsupported setting '{settingName}' What it means
SiteSettingsDeploymentSource.ProcessAsync has an exhaustive switch over known site setting names when building a site-settings deployment plan; an unrecognized setting name hits the default case and throws InvalidOperationException. This guards the export step list against unknown or renamed setting keys.
Solutions
- Update Orchard Core so the setting name is supported by the deployment source
- Remove the unknown setting name from the deployment plan's Settings list
- If a custom setting, implement a custom deployment source instead of extending the stock list
Example fix
// before "Settings": ["BaseUrl", "MyCustomSetting"] // after "Settings": ["BaseUrl"] // remove unsupported entries
Defensive patterns
Strategy: validation
Validate before calling
var supported = new HashSet<string>{"CacheMode", /* ...all switch cases */}; var bad = plan.Settings.Where(s => !supported.Contains(s)).ToList(); if (bad.Any()) throw new InvalidOperationException($"Unsupported settings: {string.Join(',', bad)}"); Try / catch
try { await source.ProcessAsync(...); } catch (InvalidOperationException e) when (e.Message.StartsWith("Unsupported setting")) { logger.LogError(e, "Deployment plan contains unsupported setting"); } Prevention
- Regenerate deployment plans after Orchard Core upgrades
- Keep plan Settings in sync with the module version
- Prefer UI-generated plans over hand-edited JSON
When it happens
Trigger: Running a site settings deployment plan whose Settings list contains a setting name not handled by the switch — e.g. after a module upgrade added a new ISite property or a hand-edited/legacy deployment plan JSON.
Common situations: Version drift: plan file created in a newer/older Orchard Core version; custom ISite extensions exporting settings the stock source doesn't know.
Related errors
- A virtual path is required
- Content Type does not exist.
- Invalid bulk action.
- Invalid bulk action.
- Operator comparer for
AI-assisted analysis of OrchardCMS/OrchardCore@4306c0717f (2026-09-13).
Data as JSON: /api/errors/1a8d555152ad3521.
Report an issue: GitHub.
Appendix: source
Thrown at src/OrchardCore.Modules/OrchardCore.Settings/Deployment/SiteSettingsDeploymentSource.cs:99
case "CdnBaseUrl":
data.Add(nameof(ISite.CdnBaseUrl), site.CdnBaseUrl);
break;
case "AppendVersion":
data.Add(nameof(ISite.AppendVersion), site.AppendVersion);
break;
case "HomeRoute":
data.Add(nameof(ISite.HomeRoute), JObject.FromObject(site.HomeRoute));
break;
case "CacheMode":
data.Add(nameof(ISite.CacheMode), JsonValue.Create(site.CacheMode));
break;
default:
throw new InvalidOperationException($"Unsupported setting '{settingName}'");
}
}
result.Steps.Add(data);
}
}
View on GitHub (pinned to 4306c0717f)