abpframework/abp · error · CliUsageException
No project file(csproj) found in the directory.
Error message
No project file(csproj) found in the directory.
What it means
The second branch of CheckWorkDirectory: the directory exists but Directory.GetFiles(directory, "*.csproj") returns no entries. The C# proxy generator needs a .csproj inside the work directory to attach the generated proxy files; absence means the work directory is not a project root.
Source
Thrown at framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ServiceProxying/CSharp/CSharpServiceProxyGenerator.cs:658
"System.Char" => "char",
"Char" => "char",
_ => typeName
};
return $"{typeName}{nullable}";
}
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(csproj) found in the directory.");
}
}
private static void CheckFolder(string folder)
{
if (!folder.IsNullOrWhiteSpace() && Path.HasExtension(folder))
{
throw new CliUsageException("Option folder should be a directory.");
}
}
}
View on GitHub (pinned to 7ed43b1931)
Solutions
- Point --work-directory at the folder that directly contains the .csproj (typically *.HttpApi.Client).
- Verify with 'ls <dir>/*.csproj'.
- If the project does not exist yet, create it (e.g. add an HttpApi.Client project) before generating proxies.
Example fix
// before abp generate-proxy -t csharp -wd ./src // no csproj directly // after abp generate-proxy -t csharp -wd ./src/Acme.App.HttpApi.Client
Defensive patterns
Strategy: validation
Validate before calling
if (!Directory.GetFiles(workDirectory, "*.csproj").Any())
{ Console.Error.WriteLine($"No .csproj in '{workDirectory}'."); return; } Prevention
- Point --work-directory at the folder that directly contains the .csproj.
- Validate csproj presence before generating proxies.
When it happens
Trigger: Pointing --work-directory at a folder that contains source files but no project file (a src/ container, a solution root with only .sln, or a folder of shared code).
Common situations: Passing the solution folder instead of the specific .HttpApi.Client project folder; multi-project folder where the .csproj is one level deeper; project recently deleted/not yet created.
Related errors
- No project file found in the directory. The working director
- package.json file not found
- angular.json file not found. You must run this command in th
- Specified directory does not exist.
- Option folder should be a directory.
AI-assisted analysis of abpframework/abp@7ed43b1931 (2026-08-13).
Data as JSON: /api/errors/3484f5e6c1997ca9.
Report an issue: GitHub.