{"record":{"id":"974a03735edd8e77","repo":"abpframework/abp","slug":"solution-name-is-not-valid-project-name-should-be","errorCode":null,"errorMessage":"Solution name is not valid. Project name should be 1 character length at minimum.","messagePattern":"Solution name is not valid\\. Project name 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":50,"sourceCode":"        }\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            {\n                throw new UserFriendlyException(\"Solution name is not valid. Project name should be 1 character length at minimum.\");\n            }\n        }\n\n        return new SolutionName(fullName, companyName, projectName);\n    }\n}\n","sourceCodeStart":32,"sourceCodeEnd":57,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/SolutionName.cs#L32-L57","documentation":"Thrown by `SolutionName.Parse(fullName)` when the name contains a `.` but the project segment (the part after the last dot) is empty. It is a `UserFriendlyException`. Example: `Acme.` yields an empty project.","triggerScenarios":"Passing a solution name ending with a dot such as `Acme.`, or a name whose trailing segment after the last dot is empty.","commonSituations":"Trailing dot typo; programmatically building a name with an empty project; accidental whitespace/dot.","solutions":["Provide a project name after the dot, e.g. `Acme.BookStore`.","If you want a single-name solution, omit the dot entirely (e.g. `Acme`).","Validate the parsed project segment is non-empty before continuing."],"exampleFix":"# before\nabp new Acme.\n# after\nabp new Acme.BookStore","handlingStrategy":"validation","validationCode":"if (fullName.Contains(\".\"))\n{\n    var project = fullName.Substring(fullName.LastIndexOf('.') + 1);\n    if (string.IsNullOrWhiteSpace(project))\n        throw new ArgumentException(\"Project name (after the dot) must be non-empty.\");\n}","typeGuard":"static bool HasValidProjectSegment(string fullName) =>\n    !fullName.Contains(\".\") || !string.IsNullOrWhiteSpace(fullName.Substring(fullName.LastIndexOf('.') + 1));","tryCatchPattern":"try { return SolutionName.Parse(fullName); }\ncatch (UserFriendlyException ex) when (ex.Message.Contains(\"Project name should be 1 character\"))\n{\n    throw new ArgumentException(\"Provide a project name after the dot (e.g. Acme.BookStore).\", nameof(fullName), ex);\n}","preventionTips":["Avoid trailing dots in solution names.","Validate both segments after splitting.","Use single-name solutions when no company is needed."],"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"}