abpframework/abp · error · UserFriendlyException

Solution name is not valid. It should be 1 character length

Error message

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

What it means

Thrown by `SolutionName.Parse(fullName)` when the supplied solution name is shorter than 1 character. It is a `UserFriendlyException`. This is the first validation before splitting the name into company/project parts.

Source

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

    private SolutionName(string fullName, string companyName, string projectName)
    {
        FullName = fullName;
        CompanyName = companyName;
        ProjectName = projectName;
    }

    public static SolutionName Parse(string fullName, string microserviceName)
    {
        microserviceName = microserviceName.Replace(".", string.Empty);
        
        return new SolutionName(fullName + "." + microserviceName, fullName, microserviceName);
    }

    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)
            {

View on GitHub (pinned to 7ed43b1931)

Solutions

  1. Provide a non-empty solution name (at least 1 character) to `abp new` / `SolutionName.Parse`.
  2. Trim and validate the name is non-empty before passing it.
  3. In automation, assert the name variable is set before invoking the CLI.

Example fix

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

Strategy: validation

Validate before calling

if (string.IsNullOrWhiteSpace(fullName))
    throw new ArgumentException("Solution name must be at least 1 character.", nameof(fullName));
var name = SolutionName.Parse(fullName);

Type guard

static bool IsValidSolutionName(string fullName) =>
    !string.IsNullOrWhiteSpace(fullName) && fullName.Trim().Length >= 1;

Try / catch

try { return SolutionName.Parse(fullName); }
catch (UserFriendlyException ex) when (ex.Message.Contains("1 character length at minimum"))
{
    throw new ArgumentException("Solution name is required.", nameof(fullName), ex);
}

Prevention

When it happens

Trigger: Calling `SolutionName.Parse` with an empty string, or invoking `abp new` with an empty/whitespace solution name argument.

Common situations: Empty argument passed to `abp new`; variable resolved to empty in a script; trailing/leading whitespace producing an effectively empty name.

Related errors


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