abpframework/abp · error · CliUsageException
Project name cannot contain ".."! Specify a different name.
Error message
Project name cannot contain ".."! Specify a different name.
What it means
Thrown by ProjectNameValidator.ValidateParentDirectoryString when the project name passed to the ABP CLI new/create command contains "..". This guards against path-traversal-style names that could escape the intended output directory when the name is used to build filesystem paths.
Source
Thrown at framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/ProjectNameValidator.cs:29
"MyProjectName",
"CON", //Windows doesn't accept these names as file name
"AUX",
"PRN",
"COM1",
"LPT2"
};
private static readonly string[] IllegalKeywords = new[]
{
"MauiBlazor",
"Blazor"
};
private static void ValidateParentDirectoryString(string projectName)
{
if (projectName.Contains(".."))
{
throw new CliUsageException("Project name cannot contain \"..\"! Specify a different name.");
}
}
private static void ValidateSurrogateOrControlChar(string projectName)
{
if (projectName.Any(chr => char.IsControl(chr) || char.IsSurrogate(chr)))
{
throw new CliUsageException("Project name cannot contain surrogate or control characters! Specify a different name.");
}
}
private static void ValidateIllegalProjectName(string projectName)
{
foreach (var illegalProjectName in IllegalProjectNames)
{
if (projectName.Equals(illegalProjectName, StringComparison.OrdinalIgnoreCase))
{
throw new CliUsageException("Project name cannot be \"" + illegalProjectName + "\"! Specify a different name.");
View on GitHub (pinned to 7ed43b1931)
Solutions
- Remove the ".." substring from the project name (use single dots to separate segments, or none).
- If you intended a relative output path, use the CLI's output-directory option instead of embedding it in the name.
- Validate the name with ProjectNameValidator.Validate before invoking the CLI programmatically.
Example fix
// before abp new Acme..BookStore // after abp new Acme.BookStore
Defensive patterns
Strategy: validation
Validate before calling
static void EnsureProjectName(string name)
{
if (name.Contains("..")) throw new ArgumentException("Project name must not contain '..'");
Volo.Abp.Cli.Utils.ProjectNameValidator.Validate(name);
} Prevention
- Run ProjectNameValidator.Validate() before invoking `abp new`.
- Use the CLI's output-directory option for paths, never embed them in the name.
- Reject names with consecutive dots upstream.
When it happens
Trigger: Running `abp new <name>` (or equivalent) where <name> contains the substring "..", e.g. "Foo..Bar", "../Escape", or "a..b". The check is a plain Contains("..") so any two consecutive dots trigger it.
Common situations: Typo with double dots in a dotted module-style name; attempt to specify a relative path as the project name; copy-paste from a namespace that contains "..".
Related errors
- Invalid npm package name detected: {SanitizeForLog(packageNa
- Invalid npm package version detected: {SanitizeForLog(versio
- Project name cannot contain surrogate or control characters!
- Project name cannot be "{illegalProjectName}"! Specify a dif
- Project name cannot contain the word "{illegalKeyword}". Spe
AI-assisted analysis of abpframework/abp@7ed43b1931 (2026-08-13).
Data as JSON: /api/errors/aef3f83ea3bfba48.
Report an issue: GitHub.