Open Closed

abp suite with microservice #2116


User avatar
0
mc86 created
  • ABP Framework version: v4.4.4
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:

HI guys I creat a microserve with abp suite,then add the services\product in it.when i creat a crud page I get error "can't find the Volo.Abp.Commercial.SuiteTemplates.dll", the dll doesn't exist in "bin\Debug\net5.0" like this url support.so I use " abp add-package Volo.Abp.Commercial.SuiteTemplates" to add the SuiteTemplates to my product.blazor project. then i get the curd page created.but when I try to build the project,I get lots of errors. one kind is "The name 'xxx' does not exist in the current context" like the L method, other one is "'OnInitializedAsync' : no suitable method found to override". the razor page has this line" @inherits ProductServiceComponentBase". I don't know how to fix and what i missed.

I have few questiones. Q1 Is the microserve project need to add the "SuiteTemplates.dll" manualy? Q2 Why the errors("cs0115,cs0103") came.how should i fix ? PS:I am dealing the problem few days.i tried to uninstall cli and the abp suite. created a new project,but noting worked. please help me out.


19 Answer(s)
  • User Avatar
    0
    berkansasmaz created
    Support Team .NET Developer

    Hi,

    Unfortunately, product service does not support code generation with Suite in versions 4.*.*. This is valid even if you add SuiteTemplates.dll manually. Please wait for 5.0.0-rc.1 to come out or try it in version 5.0.0.beta.*.

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi @mc86, as @berkansasmaz mentioned product service does not support code generation with Suite in versions 4.*.*. But you can create a new microservice and then generate CRUD pages for it.

  • User Avatar
    0
    mc86 created

    I fllowed @EngincanV's suggestion ,use "abp new OA -t microservice-service-pro" then "dotnet build" but still get "The name 'xxx' does not exist in the current" and "'OnInitializedAsync' : no suitable method found to override" in my CRUD page

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi @mc86, after creating the new microservice did you follow the documentation?

    After applyng the steps in the documentation you should be able to generate CRUD pages for your microservice.

  • User Avatar
    0
    mc86 created

    HI @EngincanV. Thanks for reply I have done those steps 1.use “abp new OrderService -t microservice-service-pro” 2.use "abp add-package Volo.Abp.Commercial.SuiteTemplates" in my blazor project. (if i don't use this i will get can't find Commercial.SuiteTemplates.dll error when generating ) 3. Copy SuiteTemplates.dll to my blazor project 4.Use suite generated a test page named "Mail".

    I can get my CRUD generated,but the page has a lot of errors.

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi @mc86, I will check and write you back asap.

  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    Did you build your new service using dotnet build /graphbuild?

  • User Avatar
    0
    mc86 created

    Hi @gterdem I fllowed the document use the "dotnet build" atfter created the project. it's ok,but after the crud page created it doen't. I try the "dotnet build /graphbuild" it dosn't work

    up to 5.0 rc1 also didn't work.as the same as4.4.4

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi @mc86, I've tried just before. I could successfully generate CRUD pages and not encounter with any dependency resolution problem. But as @gterdem mentioned, i use the dotnet build /graphBuild command in my root directory to ensure the solution is completely built.

    Can you first execute the delete-bin-obj-folders.bat file to delete all bin/obj folders that generated before and then run the dotnet build /graphBuild on your root directory?

    up to 5.0 rc1 also didn't work.as the same as4.4.4

    ABP Commercial 5.0.0-rc.1 release has just been completed, so when you updated to 5.0.0-rc.1 it probably still used the v4.4.4 or it should have given some errors.

    2.use "abp add-package Volo.Abp.Commercial.SuiteTemplates" in my blazor project. (if i don't use this i will get can't find Commercial.SuiteTemplates.dll error when generating

    I've encountered this problem with MVC page generation, it really sometimes happen but after adding this .dll file into the relevant project directory, I could generate CRUD pages for MVC UI as well.

  • User Avatar
    0
    mc86 created

    HI @EngincanV did your try blazor ui? I capture my opreating screen in mp4,may I send to you?

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    HI @EngincanV did your try blazor ui? I capture my opreating screen in mp4,may I send to you?

    Yes, I've tried Blazor UI and I could successfully generate CRUD pages.

    You can send the video to engin.veske@volosoft.com.

  • User Avatar
    0
    mc86 created

    @EngincanV I have send my video to you.

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    @mc86 I got your mail, I will watch the video and write you back asap.

  • User Avatar
    1
    gterdem created
    Senior .NET Developer

    Can you share the video of the problem or a public platform and sharing link here so other people can also benefit from the solution of this problem?

  • User Avatar
    0
    mc86 created

    HI @gterdem I put my video in https://drive.google.com/file/d/1gzh5A5JUfO9mj8Ts8FKEw6CVRN0YoQmd/view?usp=sharing. for convenient you can share the video to other platform which you want.

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi @mc86, I watched your video and I noticed your ABP Suite and ABP project versions are different. (Suite runs in v5.0.0-rc.1 and your project created in v4.4.4)

    ( A screenshot from your video, 4:05) It used the cached template. (v4.4.4)

    Please apply these steps:

    1-) Ensure you've upgraded both CLI and Suite versions to 5.0.0-rc.1.

    dotnet tool update Volo.Abp.Cli -g --version 5.0.0-rc.1
    dotnet tool update Volo.Abp.Suite -g --version 5.0.0-rc.1
    

    2-) Delete the microservice-pro template for v5.0.0-rc.1, if you've created yesterday. (Because we've updated ms-pro template for Blazor UI yesterday.)

    (Delete this zip file: %UserProfile%\.abp\templates\microservice-pro-5.0.0-rc.1.zip)

    3-) Create a microservice template via CLI or Suite.

    CLI:

    abp new <solution name> -t microservice-pro -u blazor --preview
    

    Suite:

    Don't forget to select "Preview" checbox.

    4-) Then click the "Add an existing solution" button on homepage of Suite, and fill the input with your product-service path.

    5-) Then click "Ok" button, and generate CRUD pages for an entity.

    6-) Finally, click the "Save and generate" button and generate CRUD pages for your product-service.


    After you've generated CRUD pages for your product-service, you will get the following error on your Blazor UI.

    We've created internal issues for these problems and they will be fixed in the next release.

    error CS0115: 'Books.OnInitializedAsync()': no suitable method found to override

    For fix this problem, open your new generated file (Book.razor.cs in our case) change the namespace of the generated file.

    Namespace should be MySptDemoForBz5001.ProductService.Blazor.Pages.ProductService (add the folder name to end of the current namespace)

    • Then change the CreateBookAsync and UpdateAsync methods like in the image below.

  • User Avatar
    0
    mc86 created

    HI @EngincanV
    about " I watched your video and I noticed your ABP Suite and ABP project versions are different. (Suite runs in v5.0.0-rc.1 and your project created in v4.4.4)" I noticed the error then when i was opreating. I delete the OA folder soon, after few second(4:30) later I create the project again use v 5.0.0 -rc1 .

    I will try with your instruction.

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    I will try your instruction.

    After following the steps, you can close the question if it works, if you still got problem please don't hesitate to write back.

  • User Avatar
    0
    mc86 created

    HI @EngincanV
    I think the namespace problem is the man reason that caused the errors. It is fine for now. Thanks for your guy's work.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11