{"record":{"id":"5386fb5f4d7d69c1","repo":"abpframework/abp","slug":"solution-name-is-not-valid-company-name-should-be","errorCode":null,"errorMessage":"Solution name is not valid. Company name should be 1 character length at minimum.","messagePattern":"Solution name is not valid\\. Company 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":45,"sourceCode":"    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            {\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":27,"sourceCodeEnd":57,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/SolutionName.cs#L27-L57","documentation":"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.","triggerScenarios":"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.","commonSituations":"Leading dot typo; constructing names programmatically and concatenating an empty company; copy-paste artifact.","solutions":["Provide a company name before the dot, e.g. `Acme.BookStore`.","If you want a single-name solution, omit the dot entirely (e.g. `BookStore`).","Validate the parsed company segment is non-empty before continuing."],"exampleFix":"# before\nabp new .BookStore\n# after\nabp new Acme.BookStore","handlingStrategy":"validation","validationCode":"if (fullName.Contains(\".\"))\n{\n    var company = fullName.Substring(0, fullName.LastIndexOf('.'));\n    if (string.IsNullOrWhiteSpace(company))\n        throw new ArgumentException(\"Company name (before the dot) must be non-empty.\");\n}","typeGuard":"static bool HasValidCompanySegment(string fullName) =>\n    !fullName.Contains(\".\") || !string.IsNullOrWhiteSpace(fullName.Substring(0, fullName.LastIndexOf('.')));","tryCatchPattern":"try { return SolutionName.Parse(fullName); }\ncatch (UserFriendlyException ex) when (ex.Message.Contains(\"Company name should be 1 character\"))\n{\n    throw new ArgumentException(\"Provide a company name before the dot (e.g. Acme.BookStore).\", nameof(fullName), ex);\n}","preventionTips":["Avoid leading dots in solution names.","Validate both company and project 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"}