{"record":{"id":"5be4eecdf9f307c8","repo":"abpframework/abp","slug":"angular-project-path-can-not-be-empty","errorCode":null,"errorMessage":"Angular project path can not be empty","messagePattern":"Angular project path can not be empty","errorType":"exception","errorClass":"CliUsageException","httpStatus":null,"severity":"error","filePath":"framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs","lineNumber":801,"sourceCode":"        Logger.LogInformation(result);\n    }\n\n    protected virtual async Task<string> CreateAngularLibraryAsync(\n        string libraryName,\n        string workingDirectory,\n        bool isSecondaryEndpoint = false,\n        bool isModuleTemplate = true,\n        bool isOverride = true)\n    {\n        //TODO: Can we improve this validations ?\n        if (string.IsNullOrWhiteSpace(libraryName))\n        {\n            throw new CliUsageException(\"Angular library name can not be empty\");\n        }\n\n        if (string.IsNullOrWhiteSpace(workingDirectory))\n        {\n            throw new CliUsageException(\"Angular project path can not be empty\");\n        }\n\n        var commandBuilder = new StringBuilder($\"npx ng g @abp/ng.schematics:create-lib --package-name {libraryName}\");\n\n        commandBuilder.Append($\" --is-secondary-entrypoint {isSecondaryEndpoint.ToString().ToLowerInvariant()}\");\n        commandBuilder.Append($\" --is-module-template {isModuleTemplate.ToString().ToLowerInvariant()}\");\n        commandBuilder.Append($\" --override {isOverride.ToString().ToLowerInvariant()}\");\n\n        var result = CmdHelper.RunCmdAndGetOutput(commandBuilder.ToString(), workingDirectory);\n        return await Task.FromResult(result);\n    }\n\n    public static class Options\n    {\n        public static class Template\n        {\n            public const string Short = \"t\";\n            public const string Long = \"template\";","sourceCodeStart":783,"sourceCodeEnd":819,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs#L783-L819","documentation":"Thrown by CreateAngularLibraryAsync during ABP CLI project creation when the workingDirectory parameter (path to the Angular app folder) is null or whitespace. In the normal flow, this value comes from Path.Combine(Directory.GetCurrentDirectory(), \"apps\", \"angular\") in ConfigureAngularAfterMicroserviceServiceCreatedAsync, so it is effectively an internal/edge-case guard. The method then runs 'npx ng g @abp/ng.schematics:create-lib' in that directory to scaffold an Angular library for a microservice service template.","triggerScenarios":"Called during microservice service template creation (ConfigureAngularAfterMicroserviceServiceCreatedAsync at line 761) when the UI framework is Angular. The workingDirectory is computed as Path.Combine(rootPath, \"apps\", \"angular\") where rootPath = Directory.GetCurrentDirectory(). An empty/whitespace result would require the current working directory to be in an abnormal state (e.g., deleted at runtime, sandboxed environment with broken cwd).","commonSituations":"Running the CLI from a directory that was deleted or unmounted mid-operation, sandboxed/containerized environments where the working directory resolves to empty, or a custom subclass overriding CreateAngularLibraryAsync with a bad path argument. Extremely rare under normal usage.","solutions":["Ensure you run the 'abp' CLI from the solution root directory that still exists","Verify the microservice solution has the expected folder structure (apps/angular should exist or be creatable)","If subclassing ProjectCreationCommandBase, ensure you pass a valid non-empty workingDirectory to CreateAngularLibraryAsync","Check that the output folder specified during 'abp new' exists and is writable"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before calling CreateAngularLibraryAsync in a subclass or test:\nif (string.IsNullOrWhiteSpace(workingDirectory))\n{\n    throw new ArgumentException(\"workingDirectory must not be empty\", nameof(workingDirectory));\n}\nif (!Directory.Exists(workingDirectory))\n{\n    throw new DirectoryNotFoundException($\"Angular app directory not found: {workingDirectory}\");\n}","typeGuard":null,"tryCatchPattern":"try\n{\n    var result = await CreateAngularLibraryAsync(libraryName, angularAppPath);\n}\ncatch (CliUsageException ex) when (ex.Message.Contains(\"Angular project path\"))\n{\n    Logger.LogError(\"Angular project path was empty. Ensure you are running from a valid solution root directory.\");\n    throw;\n}","preventionTips":["Always run 'abp new' or microservice commands from the intended solution root directory","Verify Directory.GetCurrentDirectory() returns a valid path before project creation","If subclassing ProjectCreationCommandBase, validate the angularAppPath before passing it"],"tags":["angular","cli","project-creation","microservice","internal"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}