{"record":{"id":"89de356bb161d2f5","repo":"abpframework/abp","slug":"solution-name-is-not-valid-it-should-be-1-charact","errorCode":null,"errorMessage":"Solution name is not valid. It should be 1 character length at minimum.","messagePattern":"Solution name is not valid\\. It should be 1 character length at minimum\\.","errorType":"exception","errorClass":"UserFriendlyException","httpStatus":null,"severity":"error","filePath":"framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/SolutionName.cs","lineNumber":31,"sourceCode":"    private SolutionName(string fullName, string companyName, string projectName)\n    {\n        FullName = fullName;\n        CompanyName = companyName;\n        ProjectName = projectName;\n    }\n\n    public static SolutionName Parse(string fullName, string microserviceName)\n    {\n        microserviceName = microserviceName.Replace(\".\", string.Empty);\n        \n        return new SolutionName(fullName + \".\" + microserviceName, fullName, microserviceName);\n    }\n\n    public static SolutionName Parse(string fullName)\n    {\n        if (fullName.Length < 1)\n        {\n            throw new UserFriendlyException(\"Solution name is not valid. It should be 1 character length at minimum.\");\n        }\n\n        string companyName = null;\n        var projectName = fullName;\n\n        if (fullName.Contains(\".\"))\n        {\n            var lastDotIndex = fullName.LastIndexOf(\".\", StringComparison.OrdinalIgnoreCase);\n            companyName = fullName.Substring(0, lastDotIndex);\n            projectName = fullName.Substring(lastDotIndex + 1);\n\n            if (companyName.Length < 1)\n            {\n                throw new UserFriendlyException(\"Solution name is not valid. Company name should be 1 character length at minimum.\");\n            }\n\n            if (projectName.Length < 1)\n            {","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/SolutionName.cs#L13-L49","documentation":"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.","triggerScenarios":"Calling `SolutionName.Parse` with an empty string, or invoking `abp new` with an empty/whitespace solution name argument.","commonSituations":"Empty argument passed to `abp new`; variable resolved to empty in a script; trailing/leading whitespace producing an effectively empty name.","solutions":["Provide a non-empty solution name (at least 1 character) to `abp new` / `SolutionName.Parse`.","Trim and validate the name is non-empty before passing it.","In automation, assert the name variable is set before invoking the CLI."],"exampleFix":"# before\nabp new \"\"\n# after\nabp new Acme.BookStore","handlingStrategy":"validation","validationCode":"if (string.IsNullOrWhiteSpace(fullName))\n    throw new ArgumentException(\"Solution name must be at least 1 character.\", nameof(fullName));\nvar name = SolutionName.Parse(fullName);","typeGuard":"static bool IsValidSolutionName(string fullName) =>\n    !string.IsNullOrWhiteSpace(fullName) && fullName.Trim().Length >= 1;","tryCatchPattern":"try { return SolutionName.Parse(fullName); }\ncatch (UserFriendlyException ex) when (ex.Message.Contains(\"1 character length at minimum\"))\n{\n    throw new ArgumentException(\"Solution name is required.\", nameof(fullName), ex);\n}","preventionTips":["Require a non-empty solution name in CLI argument parsing.","Trim and validate names in scripts before calling `abp new`.","Assert the name variable is non-null/non-empty in automation."],"tags":["cli","project-building","solution-name","validation"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}