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"
}
}
}
}
}
}
4 Answer(s)
-
0
To resolve the
[Project Not Found] Either define a default project in your workspace or specify the project name in schematics options
error when runningabp generate-proxy
with Angular 19 and ABP 9.2.2, follow these steps:Do NOT add
defaultProject
toangular.json
The Angular 16+ workspace schema no longer supports thedefaultProject
property, so adding it will cause a schema validation error.Explicitly Specify the Angular Project
SincedefaultProject
is not allowed, you must use the--project
(or-p
) option to specify your Angular project name. In your case, the project name isMYPROJECT3
.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 underprojects
in yourangular.json
(case-sensitive).
Ensure the Angular Project Structure is Correct
- Your
angular.json
must have the correct structure, and the project name must be present under theprojects
node. - The
sourceRoot
androot
properties should be correct (as in your sample).
- Your
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
.
- If you still get the error, ensure you are running the command from the root of your Angular workspace (where
Update ABP CLI and Schematics
- Make sure you are using the latest ABP CLI and
@abp/ng.schematics
package:
- Make sure you are using the latest ABP CLI and
dotnet tool update -g Volo.Abp.Cli npm install @abp/ng.schematics --save-dev
- 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:
- Service Proxies: Angular Project Configuration
- ABP Support: Project Not Found error
- ABP Support: Root Namespace Not Found
- ABP Support: Multiple APIs and project selection
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.
-
0
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.
-
0
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:
https://abp.io/docs/latest/cli#generate-proxy
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.
-
0
Thanks - below worked for me
abp generate-proxy --type ng --target MYPROJECT3 --source MYPROJECT3 --url https://localhost:44369 --module app