Open Closed

Blazor-Wasm-without-auto-discover-AppService-Proxies in runtime #8787


User avatar
0
mariovh created
  • ABP Framework version: v8.3.2
  • UI Type: Blazor WASM
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes

Hello,

I am experiencing severe startup delays in the WASM application once the WASM assemblies are loaded in the browser.

One of the options we are considering with my colleagues to improve the startup performance of the application after downloading the WASM file is to avoid generating proxies at runtime. Since reflection is costly in WebAssembly, this would save computation time and potentially eliminate the request to the api-definition endpoint, which also introduces a delay.

Would it be possible to generate these proxies at compile time instead?

In a Blazor solution, would this be complex or resource-intensive? Is there any command available in the ABP suite to achieve this?

What would be the recommended steps to follow to enable this feature?

Thank you for your support.

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

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

    Hello Mariovh,

    You can check our Static C# API Client Proxies document for this. https://abp.io/docs/latest/framework/api-development/static-csharp-clients

    Also, if you are having performance issues, I can recommend you to switch to Blazor WebApp from Blazor WASM. See differences: https://medium.com/@meghnav274/blazor-server-vs-blazor-webassembly-vs-blazor-web-app-8fe8fc1cefeb

    Here is the migrating document: https://abp.io/docs/9.0/release-info/migration-guides/abp-8-2-blazor-web-app

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    mariovh created

    Hello, I created a solution using the command:

    abp new Acme.BookStore -u blazor-webapp -m none --theme leptonx -csf

    After making changes to BookStoreHttpApiClientModule to use static clients, I ran the command to generate the clients, but I got the following error in the CLI (as shown in the image).

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    mariovh created

    Hello,

    I tried updating abp cli, same error:

    Thank you

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    berkansasmaz created
    Support Team .NET Developer

    abp generate-proxy -t csharp -u https://localhost:44361/ -m YourModuleName

    You can get the modules on https://YourWebsite/api/abp/api-definition

    eg https://abp.io//api/abp/api-definition

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    mariovh created

    It works correctly, but if I load the application on a page that injects an IApplicationService, when the render mode is Server, it says that it is not registered.

    However, if I enter the application through the dashboard and, once the WASM is downloaded, I navigate to the page that has the IAppService, then in Client render mode, it works fine and correctly resolves the dependency injection.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    berkansasmaz created
    Support Team .NET Developer

    Hi Mariovh,

    It works correctly, but if I load the application on a page that injects an IApplicationService, when the render mode is Server, it says that it is not registered.

    Your last question seems quite different from the initial one. Can you create a separate question for this topic?

    Thank you for your understanding.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.