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

  1. Remove the ".." substring from the project name (use single dots to separate segments, or none).
  2. If you intended a relative output path, use the CLI's output-directory option instead of embedding it in the name.
  3. 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

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


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