abpframework/abp · error · CliUsageException

No project file found in the directory. The working director

Error message

No project file found in the directory. The working directory must have a Web project file.

What it means

Second branch of the JS generator's CheckWorkDirectory: the directory exists but contains no .csproj. The JavaScript proxy generator still needs a Web project file in the work directory to read the application service metadata from the compiled backend, even though output is JS/TS.

Source

Thrown at framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ServiceProxying/JavaScript/JavaScriptServiceProxyGenerator.cs:85

        if (File.Exists(filePath))
        {
            File.Delete(filePath);
        }

        Logger.LogInformation($"Delete {GetLoggerOutputPath(filePath, args.WorkDirectory)}");
    }

    private static void CheckWorkDirectory(string directory)
    {
        if (!Directory.Exists(directory))
        {
            throw new CliUsageException("Specified directory does not exist.");
        }

        var projectFiles = Directory.GetFiles(directory, "*.csproj");
        if (!projectFiles.Any())
        {
            throw new CliUsageException(
                "No project file found in the directory. The working directory must have a Web project file.");
        }
    }

    private static string RemoveInitializedEventTrigger(string script)
    {
        return script.Replace(EventTriggerScript, string.Empty);
    }
}

View on GitHub (pinned to 7ed43b1931)

Solutions

  1. Point --work-directory at the folder containing the Web .csproj (typically *.Web or *.Web.Host).
  2. Confirm with 'ls <dir>/*.csproj'.
  3. Create the Web project first if it does not exist.

Example fix

// before
abp generate-proxy -t js -wd ./angular   // no csproj
// after
abp generate-proxy -t js -wd ./src/Acme.App.Web
Defensive patterns

Strategy: validation

Validate before calling

if (!Directory.GetFiles(workDirectory, "*.csproj").Any())
{ Console.Error.WriteLine($"No Web project (.csproj) in '{workDirectory}'."); return; }

Prevention

When it happens

Trigger: Pointing the JS proxy generator at a folder with no .csproj (e.g. the angular/ folder alone, a docs folder, or a solution root containing only .sln).

Common situations: Passing the front-end folder instead of the ASP.NET Core Web project folder; the Web .csproj lives one level deeper; project not created yet.

Related errors


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