Open Closed

How and where to Create static proxies in the microservices solution created by abp studio #9128


User avatar
0
SandeepPareek created

Earlier we used to have a .Client project where we store proxies but this is not available in the new microservices template created by abp studio. so How and where to create static proxies

I am tyring to create it in the Blazor web app but when I create the proxy through abp generate-proxy -t csharp -m myprabh -u http://localhost:44314/ it only generates the json file but no proxy files.

  • Exception message and full stack trace: No Exceptions comes when run abp genearate... and only json file is created

  • Steps to reproduce the issue:

aa.png


7 Answer(s)
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi, If you are using ABP Studio, then in your final application, you can directly generate C# proxies, through ABP Studio UI. Please check https://abp.io/docs/latest/tutorials/microservice/part-03#generating-the-ui-proxy (this is explained for MVC, but it's not so different in the Blazor side, you should do it in your final blazor application)

  • User Avatar
    0
    SandeepPareek created

    Thanks EngincanV that is quite helpful. I will use this method from now on.

    But I would like to inform you that I am still not able to see proxies yet.

    image.png

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Thanks EngincanV that is quite helpful. I will use this method from now on.

    But I would like to inform you that I am still not able to see proxies yet.

    image.png

    Thanks for your prompt response. Let me check it and write you back then.

  • User Avatar
    0
    SandeepPareek created

    @EngincanV
    FYI, I am facing this issue when I am trying to create proxy based on a microservice that I created along the basic other prebuilt microservice in the initial project creation time using abp studio.

    I found I am able to create proxy for chat microservice.

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi, you should run your service while generating client proxies. To demonstrate it, I have created a CatalogMicroservice and then, expanded my blazor webapp project, right-click to generate client-proxies and you can see the configuration below:

    image.png

    Then, when it's completed:

    image.png

    I can see the client-proxies in my project:

    • both in ABP Studio UI (so I can re-generate it again if I want):

    image.png

    • and also in my project's ClientProxies folder:

    image.png

  • User Avatar
    0
    SandeepPareek created

    Strange. It only generates json file for me.
    I am stuck and there is not error to look into.

    Mine project is blazor server based and you are using blazor web app template.
    It is possible for you to try it with blazor server template?

    image.png
    image.png

    FYI
    proxies are created for abp
    image.png
    but not myPrabh

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Strange. It only generates json file for me.
    I am stuck and there is not error to look into.

    Mine project is blazor server based and you are using blazor web app template.
    It is possible for you to try it with blazor server template?

    image.png
    image.png

    FYI
    proxies are created for abp
    image.png
    but not myPrabh

    Hi, I've checked with your exact configuration, but still could not reproduce it, please see the steps below:

    1-) Created microservice solution:

    image.png

    2-) Created a new service called MyPrabhService (and also created a dummy appservice -> ProductAppService.cs)

    image.png

    image.png

    3-) Then, run all services and try to generate client proxies:

    image.png

    image.png

    All of the proxies are generated correctly ( I only defined GetProductsAsync method in my dummy ProductAppService class):

    image.png


    Please ensure that you have created the server by using our Microservice template, and in your blazor-server project there is a configuration as below:

            context.Services.AddStaticHttpClientProxies(typeof(Issue9128BzServerMyPrabhServiceContractsModule).Assembly);
    
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on April 11, 2025, 10:10