Open Closed

abp generate-proxy error on migration #9730


User avatar
0
rmudavath created

when I try to run below from my angular folder

abp generate-proxy -t ng --url https://localhost:44369 --target src/app/proxy --project MYPROJECT3 --all --force

ABP CLI 9.2.2 [Project Not Found] Either define a default project in your workspace or specify the project name in schematics options.

If I add "defaultProject": "MYPROJECT3" then I get error -> Property defaultProject is not allowed.

please be advised that https://localhost:44369/api/abp/api-definition is accessible when I am run the command

I am trying to upgrade from angular 11 , ABP 4.1.0 to Angular 19.2 , ABP 9.2.2

ng version

Angular CLI: 19.2.15 Node: 20.11.1 Package Manager: npm 10.2.4 OS: win32 x64

Angular: 19.2.14 ... animations, common, compiler, compiler-cli, core, forms ... language-service, localize, platform-browser ... platform-browser-dynamic, router, service-worker

Package Version

@angular-devkit/architect 0.1902.15 @angular-devkit/build-angular 19.2.15 @angular-devkit/core 19.1.9 @angular-devkit/schematics 19.1.9 @angular/cdk 19.2.19 @angular/cli 19.2.15 @schematics/angular 19.2.15 ng-packagr 19.0.0 rxjs 7.8.2 typescript 5.6.3 zone.js 0.15.1

the following files exist in my project (this is a migration) src/index.html src/main.ts src/polyfills.ts tsconfig.app.json src/styles.scss src/assets/

below is angular.json (this is reduced and minimal form of my angular.json)

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "projects": {
    "MYPROJECT3": {
      "projectType": "application",
      "root": "",
      "sourceRoot": "src",
      "prefix": "app",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:application",
          "options": {
            "outputPath": "dist/MYPROJECT3",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "tsconfig.app.json",
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ],
            "styles": [
              "src/styles.scss"
            ],
            "scripts": []
          }
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "MYPROJECT3:build"
          }
        }
      }
    }
  }
}
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

4 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent

    To resolve the [Project Not Found] Either define a default project in your workspace or specify the project name in schematics options error when running abp generate-proxy with Angular 19 and ABP 9.2.2, follow these steps:

    1. Do NOT add defaultProject to angular.json
      The Angular 16+ workspace schema no longer supports the defaultProject property, so adding it will cause a schema validation error.

    2. Explicitly Specify the Angular Project
      Since defaultProject is not allowed, you must use the --project (or -p) option to specify your Angular project name. In your case, the project name is MYPROJECT3.

      Example:

    abp generate-proxy -t ng --url https://localhost:44369 --target src/app/proxy --project MYPROJECT3 --all --force
    
    • Make sure the value for --project matches exactly the key under projects in your angular.json (case-sensitive).
    1. Ensure the Angular Project Structure is Correct

      • Your angular.json must have the correct structure, and the project name must be present under the projects node.
      • The sourceRoot and root properties should be correct (as in your sample).
    2. Check for Workspace Issues

      • If you still get the error, ensure you are running the command from the root of your Angular workspace (where angular.json is located).
      • If you have multiple Angular projects, always specify the correct one with --project.
    3. Update ABP CLI and Schematics

      • Make sure you are using the latest ABP CLI and @abp/ng.schematics package:
    dotnet tool update -g Volo.Abp.Cli
         npm install @abp/ng.schematics --save-dev
    
    1. Proxy Generation Command Example
      Here is the full command you should use:
    abp generate-proxy -t ng --url https://localhost:44369 --target src/app/proxy --project MYPROJECT3 --all --force
    

    If you follow these steps and still encounter the error, double-check the spelling and casing of your project name in both the command and angular.json.


    Sources:


    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    rmudavath created

    I checked the links and checked all the 3 points - I am still getting

    $ abp generate-proxy -t ng --url https://localhost:44369 --target src/app/proxy --project MYPROJECT3 --all --force ABP CLI 9.2.3 [Project Not Found] Either define a default project in your workspace or specify the project name in schematics options.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    sumeyye.kurtulus created
    Support Team Angular Expert

    Hello,

    You should not need to pass these parameters

    --target src/app/proxy (since it will already targetted here)
    --project MYPROJECT3 (you already have one project registered in angular.json)
    --all --force 
    

    You can refer to these documents:

    1. https://abp.io/docs/latest/cli#generate-proxy

    2. https://abp.io/docs/latest/framework/ui/angular/service-proxies

    This command would be enough abp generate-proxy -t ng -url https://localhost:44369

    If you think that it does not solve your problem, I can assist you further.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    rmudavath created

    Thanks - below worked for me

    abp generate-proxy --type ng --target MYPROJECT3 --source MYPROJECT3 --url https://localhost:44369 --module app

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.