OrchardCMS/OrchardCore · error · ArgumentException
Content type name is reserved for internal use
Error message
Content type name is reserved for internal use
What it means
ContentTypeDefinitionBuilder.Build() rejects content type names considered reserved for internal use via IsReservedContentName(). Orchard reserves names starting with prefixes like 'List', 'Container', or otherwise colliding with internal systems, to prevent ambiguity with framework-generated content types.
Solutions
- Rename the content type to a non-reserved name (prefix with your module/brand, e.g. 'MyModuleListItem')
- Reuse the built-in List/Container types instead of defining a colliding name
- Update all references: migrations, recipes, placement.json, and queries that reference the old name
Example fix
// before
builder.AlterTypeDefinitionAsync("ListItem", t => t.WithDisplayName("List Item"));
// after
builder.AlterTypeDefinitionAsync("MyStoreListItem", t => t.WithDisplayName("List Item")); Defensive patterns
Strategy: validation
Validate before calling
if (typeName.IsReservedContentName())
throw new ArgumentException($"'{typeName}' is reserved for internal use; choose another name."); Try / catch
try
{
await builder.AlterTypeDefinitionAsync(name, configure);
}
catch (ArgumentException ex) when (ex.Message.Contains("reserved"))
{
_logger.LogError(ex, "Content type name '{Name}' is reserved", name);
} Prevention
- Prefix custom type names with your module or brand to avoid reserved names like 'List*'
- Check IsReservedContentName() in migrations before altering definitions
- Reuse built-in List/Container types rather than shadowing them
When it happens
Trigger: Calling AlterTypeDefinitionAsync with a name matching a reserved pattern (e.g. names starting with 'List' or other reserved prefixes defined in StringExtensions.IsReservedContentName)
Common situations: Creating types like 'ListItem' or 'List' for custom listing features; renaming existing internal types; migrating legacy systems where 'List' was not reserved
Understand the failure class
Background: "invalid id" errors: invalid identifier format — why libraries reject IDs before lookup, and how to fix them — this error's family across 37 libraries.
Related errors
- Content type name contains invalid characters
- Content part name must start with a letter
- Content part name contains invalid characters
- Content part name must start with a letter
- Content part name contains invalid characters
AI-assisted analysis of OrchardCMS/OrchardCore@4306c0717f (2026-09-13).
Data as JSON: /api/errors/b43d43324d30a05d.
Report an issue: GitHub.
Appendix: source
Thrown at src/OrchardCore/OrchardCore.ContentManagement.Abstractions/Metadata/Builders/ContentTypeDefinitionBuilder.cs:51
_displayName = existing.DisplayName;
_parts = existing.Parts.ToList();
_settings = existing.Settings.Clone();
}
}
public ContentTypeDefinition Build()
{
if (!char.IsLetter(_name[0]))
{
throw new ArgumentException("Content type name must start with a letter", "name");
}
if (!string.Equals(_name, _name.ToSafeName(), StringComparison.OrdinalIgnoreCase))
{
throw new ArgumentException("Content type name contains invalid characters", "name");
}
if (_name.IsReservedContentName())
{
throw new ArgumentException("Content type name is reserved for internal use", "name");
}
return new ContentTypeDefinition(_name, _displayName, _parts, _settings);
}
[Obsolete("This method has been deprecated, please use WithName() instead.")]
public ContentTypeDefinitionBuilder Named(string name) => WithName(name);
public ContentTypeDefinitionBuilder WithName(string name)
{
_name = name;
return this;
}
[Obsolete("This method has been deprecated, please use WithDisplayName() instead.")]
public ContentTypeDefinitionBuilder DisplayedAs(string displayName) => WithDisplayName(displayName);
View on GitHub (pinned to 4306c0717f)