ABP version: 4.2.1
Steps to reproduce:
- abp new CustomerX -t app-pro --create-solution-folder --preview --output-folder p:\development\
- abp new CustomerX.APIY -t module-pro --preview --create-solution-folder --output-folder p:\development\CustomerX modules --no-ui
I then added the "CustomerX.ApiY" projects necessary to the solution. Because the API has no dependency on a database (it is used to call a thirdparty api) I removed everything which is related to databases (removed the nuget packages, and all the code related).
So this gives me this solution:
And this is the HostModule for the (httpApi.Host) module:
I then run the Suite to add an entity but it gives me this error when i click : Save and Generate:
"Error occurred on DB migration step: MSBUILD : error MSB1009: Project file does not exist. Switch: ../CustomerX.HttpApi.Host Unable to retrieve project metadata. Ensure it's an SDK-style project. If you're using a custom BaseIntermediateOutputPath or MSBuildProjectExtensionsPath values, Use the --msbuildprojectextensionspath option."
I think it is still trying the run the migrations for the CustomerX.ApiY module? All entity files are created correctly but the only thing that is failing, is creating the DB migrations.
Is there a way to fix this?
Kind Regards,
Alfred
12 Answer(s)
-
1
Cant reproduce this issue anymore myself. Case closed!
-
0
Sorry, have to reopen this. I did some testing this morning and the error did not occur so i thought it was a fault on my side but i just got the error again and pinpointed the issue.
To reproduce:
- run: abp new CustomerX -t app-pro --create-solution-folder --preview --output-folder p:\development\
- run: abp new CustomerX.APIY -t module-pro --preview --create-solution-folder --output-folder p:\development\CustomerX\modules --no-ui
- Run the DBMigrator so the database get's created and seeded.
- Start the abp suite en open the solution in the abp suite.
- Add a new entity and press "Save and generate"
Notice that an error occurs:
"Unable to retrieve project metadata. Ensure it's an SDK-style project. If you're using a custom BaseIntermediateOutputPath or MSBuildProjectExtensionsPath values, Use the --msbuildprojectextensionspath option."
To fix this you can do the following:
Open the abp suite and open the solution BEFORE adding the module OR move the "modules" folder temporary and open the solution in the abp suite.
My guess is that the msbuildprojectextensionspath is not getting set correclty when the module is already in the solution folder.
When the error occurs i noticed that the suite has made a OBJ directory in the wrong path:
So there is definitely somthing going wrong with a path.
-
0
-
0
Hi Alper,
Thanks for your response. This works indeed.
But what would be the equivalent CLI command?? We would rather add modules via the CLI so we can easily automate our solution-creation.
I also noticed that when we do the following:
- run: abp new CustomerX -t app-pro --create-solution-folder --preview --output-folder p:\development\
- run: abp add-module CustomerX.ApiY --new --add-to-solution-file
- Run the DBMigrator so the database get's created and seeded.
- Start the abp suite en open the solution in the abp suite.
- Add a new entity and press "Save and generate"
everything works as well!
But in step 2 we use the add-module and this will not add the pro-module unfortunately. Is there a add-module cli command that will add the pro version?
-
0
you can use the following CLI command to add a new module to your existing solution.
abp add-module ProductManagement --new --solution C:\YourSolutionPath --add-to-solution-file
https://docs.abp.io/en/abp/latest/CLI#options-3
-
0
Hi Alper,
Thanks for your quick response.
abp add-module ProductManagement --new --solution C:\YourSolutionPath --add-to-solution-file
Is not adding the pro version of the module template (https://docs.abp.io/en/abp/latest/Startup-Templates/Module). For instance, I am missing the host folder:
I just noticed that the ABP suite is not using the pro version as well when you use the "Create new module" button:
That's why I used:
abp new CustomerX.APIY -t module-pro --preview --create-solution-folder --output-folder p:\development\CustomerX\modules --no-ui
because this command WILL add the host folder! But, as far as i know, there is no way to add it to an existing solution?
But nevertheless i still feel that the ABP suite is containing a bug for solutions which have modules in them, because "save and generate" keeps failing when i create a new entity in the suite. And that is the reason we bought the license.
Just perform these simple steps and you will see:
- run: abp new CustomerX -t app-pro --create-solution-folder --preview --output-folder p:\development\
- run: abp new CustomerX.APIY -t module-pro --preview --create-solution-folder --output-folder p:\development\CustomerX\modules --no-ui
- Run the DBMigrator so the database get's created and seeded.
- Start the abp suite en open the solution in the abp suite.
- Add a new entity and press "Save and generate"
- Notice that an error occurs
-
0
Are you trying to create an entity to your main project or to your module?
-
0
To the main project
-
0
Hi @Frontis1,
Suite uses pro module template when you create a new module on
Create new module
dialog. And to make cli use pro module template, add-t module-pro
argument to command. example:abp add-module ProductManagement --new --solution C:\YourSolutionPath --add-to-solution-file -t module-pro
For instance, I am missing the host folder
Yes, there is no host folder and host projects. they are deleted because they are no longer needed to test your module.
The problem you have encountered should be because of manuel creation of inner module. You should have no problem when you add the module to your solution the way i explained above (Suite
Create new module
dialog). -
0
@Frontis1 i also tested the way you added the module and there was no error. May your ABP Suite version be outdated?
-
0
I must say that the ABP CLI version and your project version must be the same.
-
0
This question has been automatically marked as stale because it has not had recent activity.