abpframework/abp · error · CliUsageException

Local paths are not specified!

Error message

Local paths are not specified!

What it means

Thrown by SwitchToLocal.GetPaths when the -p/--paths option is entirely absent from the command line. This option is required and specifies the local source paths where the ABP framework source code lives. Multiple paths are separated by the pipe character '|'. The GetOrNull call returns null when the option key is not present in the parsed command-line arguments.

Source

Thrown at framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SwitchToLocalCommand.cs:51

                "Specified directory does not exist." +
                Environment.NewLine + Environment.NewLine +
                GetUsageInfo()
            );
        }

        await _localReferenceConverter.ConvertAsync(workingDirectory, GetPaths(commandLineArgs));
    }

    private List<string> GetPaths(CommandLineArgs commandLineArgs)
    {
        var paths = commandLineArgs.Options.GetOrNull(
            Options.LocalPaths.Short,
            Options.LocalPaths.Long
        );

        if (paths == null)
        {
            throw new CliUsageException(
                "Local paths are not specified!" +
                Environment.NewLine + Environment.NewLine +
                GetUsageInfo()
            );
        }

        return paths.Split("|").Select(x=> x.Trim()).ToList();
    }

    private string GetWorkingDirectory(CommandLineArgs commandLineArgs)
    {
        var path = commandLineArgs.Options.GetOrNull(
            Options.SolutionPath.Short,
            Options.SolutionPath.Long
        );

        if (path == null)
        {

View on GitHub (pinned to 7ed43b1931)

Solutions

  1. Add --paths <local-abp-source-path> to your command
  2. For multiple source paths, separate with pipe: --paths "D:\Github\abp|D:\Github\volo"
  3. Run 'abp help switch-to-local' to see the required options

Example fix

// before
abp switch-to-local

// after
abp switch-to-local --paths D:\Github\abp
Defensive patterns

Strategy: validation

Validate before calling

// Validate that --paths is provided
if (!commandLineArgs.Options.ContainsKey("p") && !commandLineArgs.Options.ContainsKey("paths"))
{
    Console.Error.WriteLine("Error: --paths is required. Example: abp switch-to-local --paths /path/to/abp");
    return;
}

Try / catch

try
{
    await switchToLocal.ExecuteAsync(commandLineArgs);
}
catch (CliUsageException ex) when (ex.Message.Contains("Local paths are not specified"))
{
    Console.Error.WriteLine("Missing required --paths option. Usage: abp switch-to-local --paths <local-source-path>");
}

Prevention

When it happens

Trigger: Running 'abp switch-to-local' without the --paths flag at all. For example: 'abp switch-to-local' alone, or 'abp switch-to-local -s /my/project' without -p.

Common situations: Developer forgets the required --paths option, confuses it with another flag name, or expects it to default to something (it does not).

Related errors


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