Base solution for your next web application
Open Closed

Power Tools do not work with Postgres Database #12093


User avatar
0
pgummadapu created

Hello,

I downloaded the latest ASP.NET Zero Power Tools onto my ASP.NET Zero Solution (Package version: 13.1.0). I am running .NET 7 for PowerTools and .NET 8 for the package solution. This is on Visual Studio 2022. Postgres is version 16.

I am successful in running the ASP.NET Zero application locally. Migration & database update process was successful (no issues).

Running Power Tools, creates the Angular and C# files but it fails to update the server database (Postgres) and fails to wrote proper service angular code into service-proxies/service-proxies file. I verified the connection string. It does not work.

These are the messages I get (attached image files) :

<this error msg is resolved but additional issues in latest update to this ticket below>

"The type initializer for 'Npgsql.TypeMapping.BuiltInTypeHandlerResolver' threw an exception, Unable to load entity from database(Postgres) using powertools "

Question 2: In Visual Studio, Power Tools has an issue with Created Powertools templates are not showing on powertools window - ASP.NET zero and how to use it?

Thank you


8 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    We will check the first problem, please follow https://github.com/aspnetzero/aspnet-zero-core/issues/5319

    I couldn't understand the Question 2, could you explain it a bit more detailed ?

    Thanks,

  • User Avatar
    0
    pgummadapu created

    Hi,

    For the 2nd question, hope this helps:

    This is the process to create power tools templates (see image). I have done with this process but, I didn't find where the output is visible. The next steps for the Implementation is not provided in the document.

    Also this link does not work: https://github.com/aspnetzero/aspnet-zero-core/issues/5319

  • User Avatar
    0
    pgummadapu created

    Also an update on the 2nd screenshot from the original post. I updated EF to latest version, it creates the table in my Postgres DB but it fails here:

    Also after I "generate" the entity & ts files, the c# compiles fine, the angular does not. It seems the generating part of the Power Tools does not properly generate the angular side of things.

    Sample of the errors:

    Error: src/app/main/signUp/signUpEntities/create-or-edit-signUpEntity-modal.component.ts:4:10 - error TS2305: Module '"@shared/service-proxies/service-proxies"' has no exported member 'SignUpEntitiesServiceProxy'.

    4 import { SignUpEntitiesServiceProxy, CreateOrEditSignUpEntityDto } from '@shared/service-proxies/service-proxies'; ~~~~~~~~~~~~~~~~~~~~~~~~~~

    Error: src/app/main/signUp/signUpEntities/create-or-edit-signUpEntity-modal.component.ts:4:38 - error TS2305: Module '"@shared/service-proxies/service-proxies"' has no exported member 'CreateOrEditSignUpEntityDto'.

    4 import { SignUpEntitiesServiceProxy, CreateOrEditSignUpEntityDto } from '@shared/service-proxies/service-proxies'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Error: src/app/main/signUp/signUpEntities/create-or-edit-signUpEntity-modal.component.ts:26:13 - error NG2003: No suitable injection token for parameter '_signUpEntitiesServiceProxy' of class 'CreateOrEditSignUpEntityModalComponent'. Consider using the @Inject decorator to specify an injection token.

    26 private _signUpEntitiesServiceProxy: SignUpEntitiesServiceProxy, ~~~~~~~~~~~~~~~~~~~~~~~~~~~

    src/app/main/signUp/signUpEntities/create-or-edit-signUpEntity-modal.component.ts:26:42 26 private _signUpEntitiesServiceProxy: SignUpEntitiesServiceProxy, ~~~~~~~~~~~~~~~~~~~~~~~~~~ This type does not have a value, so it cannot be used as injection token.

    Error: src/app/main/signUp/signUpEntities/signUpEntities.component.ts:4:10 - error TS2305: Module '"@shared/service-proxies/service-proxies"' has no exported member 'SignUpEntitiesServiceProxy'.

    4 import { SignUpEntitiesServiceProxy, SignUpEntityDto } from '@shared/service-proxies/service-proxies'; ~~~~~~~~~~~~~~~~~~~~~~~~~~

    Error: src/app/main/signUp/signUpEntities/signUpEntities.component.ts:4:38 - error TS2724: '"@shared/service-proxies/service-proxies"' has no exported member named 'SignUpEntityDto'. Did you mean 'IEntityDto'?

    4 import { SignUpEntitiesServiceProxy, SignUpEntityDto } from '@shared/service-proxies/service-proxies'; ~~~~~~~~~~~~~~~

    Error: src/app/main/signUp/signUpEntities/signUpEntities.component.ts:51:13 - error NG2003: No suitable injection token for parameter '_signUpEntitiesServiceProxy' of class 'SignUpEntitiesComponent'.
    Consider using the @Inject decorator to specify an injection token.

    51 private _signUpEntitiesServiceProxy: SignUpEntitiesServiceProxy, ~~~~~~~~~~~~~~~~~~~~~~~~~~~

    src/app/main/signUp/signUpEntities/signUpEntities.component.ts:51:42 51 private _signUpEntitiesServiceProxy: SignUpEntitiesServiceProxy, ~~~~~~~~~~~~~~~~~~~~~~~~~~ This type does not have a value, so it cannot be used as injection token.

    Error: src/app/main/signUp/signUpEntities/signUpEntity.module.ts:10:18 - error NG6001: The class 'SignUpEntitiesComponent' is listed in the declarations of the NgModule 'SignUpEntityModule', but is not a directive, a component, or a pipe. Either remove it from the NgModule's declarations, or add an appropriate Angular decorator.

    10 declarations: [SignUpEntitiesComponent, CreateOrEditSignUpEntityModalComponent, ViewSignUpEntityModalComponent], ~~~~~~~~~~~~~~~~~~~~~~~

    src/app/main/signUp/signUpEntities/signUpEntities.component.ts:30:14 30 export class SignUpEntitiesComponent extends AppComponentBase { ~~~~~~~~~~~~~~~~~~~~~~~ 'SignUpEntitiesComponent' is declared here.

    Error: src/app/main/signUp/signUpEntities/signUpEntity.module.ts:10:43 - error NG6001: The class 'CreateOrEditSignUpEntityModalComponent' is listed in the declarations of the NgModule 'SignUpEntityModule', but is not a directive, a component, or a pipe. Either remove it from the NgModule's declarations, or add an appropriate Angular decorator.

    10 declarations: [SignUpEntitiesComponent, CreateOrEditSignUpEntityModalComponent, ViewSignUpEntityModalComponent], ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    src/app/main/signUp/signUpEntities/create-or-edit-signUpEntity-modal.component.ts:14:14 14 export class CreateOrEditSignUpEntityModalComponent extends AppComponentBase implements OnInit { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 'CreateOrEditSignUpEntityModalComponent' is declared here.

    Error: src/app/main/signUp/signUpEntities/view-signUpEntity-modal.component.ts:4:10 - error TS2305: Module '"@shared/service-proxies/service-proxies"' has no exported member 'GetSignUpEntityForViewDto'.

    4 import { GetSignUpEntityForViewDto, SignUpEntityDto } from '@shared/service-proxies/service-proxies'; ~~~~~~~~~~~~~~~~~~~~~~~~~

    Error: src/app/main/signUp/signUpEntities/view-signUpEntity-modal.component.ts:4:37 - error TS2724: '"@shared/service-proxies/service-proxies"' has no exported member named 'SignUpEntityDto'. Did you mean 'IEntityDto'?

    4 import { GetSignUpEntityForViewDto, SignUpEntityDto } from '@shared/service-proxies/service-proxies'; ~~~~~~~~~~~~~~~

    Error: src/shared/service-proxies/service-proxy.module.ts:10:27 - error TS2339: Property 'SignUpEntitiesServiceProxy' does not exist on type 'typeof import("C:/Users/mirsk/Desktop/Business/Contracting/Disruptive Tech Solutions/Projects/DTS-Research/src/DTS.Web.Host/src/shared/service-proxies/service-proxies")'.

    10 ApiServiceProxies.SignUpEntitiesServiceProxy, ~~~~~~~~~~~~~~~~~~~~~~~~~~

    × Failed to compile.

  • User Avatar
    0
    m.aliozkaya created
    Support Team

    Hi @pgummadapu,

    The PostgreSQL error will be resolved in the next version.

    For the second error please run in the Angular folder when the Host is live. yarn run nswag

  • User Avatar
    0
    pgummadapu created

    Thank you for the reply. When are you planning to release the next version?

  • User Avatar
    0
    ismcagdas created
    Support Team

    @pgummadapu It is planned for today.

  • User Avatar
    0
    pgummadapu created

    I am sorry, is this a the Power Tools (RAD) update or ASP.NET Zero solution update?

    also, can you respond to my questions about templates. Is there additional articles or info on how to use/utilize the templates?

  • User Avatar
    0
    m.aliozkaya created
    Support Team

    Hi @pgummadapu,

    If you update your Power Tools extension your problem will be resolved. I will review the document as soon as possible and try to make it more understandable and accurate.