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

  1. Update Orchard Core so the setting name is supported by the deployment source
  2. Remove the unknown setting name from the deployment plan's Settings list
  3. 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

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


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)