abpframework/abp · error · UserFriendlyException

Solution name is not valid. Company name should be 1 charact

Error message

Solution name is not valid. Company name should be 1 character length at minimum.

What it means

Thrown by `SolutionName.Parse(fullName)` when the name contains a `.` but the company segment (the part before the last dot) is empty. It is a `UserFriendlyException`. Example: `.BookStore` yields an empty company.

Source

Thrown at framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/SolutionName.cs:45

    public static SolutionName Parse(string fullName)
    {
        if (fullName.Length < 1)
        {
            throw new UserFriendlyException("Solution name is not valid. It should be 1 character length at minimum.");
        }

        string companyName = null;
        var projectName = fullName;

        if (fullName.Contains("."))
        {
            var lastDotIndex = fullName.LastIndexOf(".", StringComparison.OrdinalIgnoreCase);
            companyName = fullName.Substring(0, lastDotIndex);
            projectName = fullName.Substring(lastDotIndex + 1);

            if (companyName.Length < 1)
            {
                throw new UserFriendlyException("Solution name is not valid. Company name should be 1 character length at minimum.");
            }

            if (projectName.Length < 1)
            {
                throw new UserFriendlyException("Solution name is not valid. Project name should be 1 character length at minimum.");
            }
        }

        return new SolutionName(fullName, companyName, projectName);
    }
}

View on GitHub (pinned to 7ed43b1931)

Solutions

  1. Provide a company name before the dot, e.g. `Acme.BookStore`.
  2. If you want a single-name solution, omit the dot entirely (e.g. `BookStore`).
  3. Validate the parsed company segment is non-empty before continuing.

Example fix

# before
abp new .BookStore
# after
abp new Acme.BookStore
Defensive patterns

Strategy: validation

Validate before calling

if (fullName.Contains("."))
{
    var company = fullName.Substring(0, fullName.LastIndexOf('.'));
    if (string.IsNullOrWhiteSpace(company))
        throw new ArgumentException("Company name (before the dot) must be non-empty.");
}

Type guard

static bool HasValidCompanySegment(string fullName) =>
    !fullName.Contains(".") || !string.IsNullOrWhiteSpace(fullName.Substring(0, fullName.LastIndexOf('.')));

Try / catch

try { return SolutionName.Parse(fullName); }
catch (UserFriendlyException ex) when (ex.Message.Contains("Company name should be 1 character"))
{
    throw new ArgumentException("Provide a company name before the dot (e.g. Acme.BookStore).", nameof(fullName), ex);
}

Prevention

When it happens

Trigger: Passing a solution name starting with a dot such as `.BookStore`, or a name that after splitting on the last dot has nothing before it.

Common situations: Leading dot typo; constructing names programmatically and concatenating an empty company; copy-paste artifact.

Related errors


AI-assisted analysis of abpframework/abp@7ed43b1931 (2026-08-13). Data as JSON: /api/errors/5386fb5f4d7d69c1. Report an issue: GitHub.