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
- Point --work-directory at the folder containing the Web .csproj (typically *.Web or *.Web.Host).
- Confirm with 'ls <dir>/*.csproj'.
- 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
- Point --work-directory at the ASP.NET Core Web project folder, not the front-end folder.
- Confirm a .csproj is present before generating JS proxies.
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
- No project file(csproj) found in the directory.
- package.json file not found
- angular.json file not found. You must run this command in th
- Option folder should be a directory.
- Specified directory does not exist.
AI-assisted analysis of abpframework/abp@7ed43b1931 (2026-08-13).
Data as JSON: /api/errors/dfe5bb2a5d2872a4.
Report an issue: GitHub.