From a19a6ffdd498a1adf730b34f826cf269f9f777aa Mon Sep 17 00:00:00 2001 From: Xavier Date: Mon, 26 Feb 2024 17:40:27 +0100 Subject: [PATCH 1/2] Added app-generate-proxy.json documentation --- docs/en/API/Static-CSharp-API-Clients.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/en/API/Static-CSharp-API-Clients.md b/docs/en/API/Static-CSharp-API-Clients.md index 85ffb3e213..bcbe7d3606 100644 --- a/docs/en/API/Static-CSharp-API-Clients.md +++ b/docs/en/API/Static-CSharp-API-Clients.md @@ -75,6 +75,12 @@ public class MyClientAppModule : AbpModule context.Services.AddStaticHttpClientProxies( typeof(MyClientAppModule).Assembly ); + + // Include the generated app-generate-proxy.json in the virtual file system + Configure(options => + { + options.FileSets.AddEmbedded(); + }); } } ```` @@ -94,6 +100,12 @@ public class MyClientAppModule : AbpModule context.Services.AddStaticHttpClientProxies( typeof(BookStoreApplicationContractsModule).Assembly ); + + // Include the generated app-generate-proxy.json in the virtual file system + Configure(options => + { + options.FileSets.AddEmbedded(); + }); } } ```` @@ -139,7 +151,7 @@ This command should generate the following files under the `ClientProxies` folde * `BookClientProxy.Generated.cs` is the actual generated proxy class in this example. `BookClientProxy` is a `partial` class * where you can write your custom code (ABP won't override it). * `IBookAppService.cs` is the app service. * `BookDto.cs` is the Dto class which uses by app service. -* `app-generate-proxy.json` contains information about the remote HTTP endpoint, so ABP can properly perform HTTP requests. +* `app-generate-proxy.json` contains information about the remote HTTP endpoint, so ABP can properly perform HTTP requests. This file must be configured as an embedded resource in your project, so that it can be found by the virtual file system. #### Without Contracts @@ -152,7 +164,7 @@ This command should generate the following files under the `ClientProxies` folde ![generated-static-client-proxies](../images/generated-static-client-proxies-without-contracts.png) * `BookClientProxy.Generated.cs` is the actual generated proxy class in this example. `BookClientProxy` is a `partial` class where you can write your custom code (ABP won't override it). -* `app-generate-proxy.json` contains information about the remote HTTP endpoint, so ABP can properly perform HTTP requests. +* `app-generate-proxy.json` contains information about the remote HTTP endpoint, so ABP can properly perform HTTP requests. This file must be configured as an embedded resource in your project, so that it can be found by the virtual file system. > `generate-proxy` command generates proxies for only the APIs you've defined in your application. If you are developing a modular application, you can specify the `-m` (or `--module`) parameter to specify the module you want to generate proxies. See the *generate-proxy* section in the [ABP CLI](../CLI.md) documentation for other options. From e41d5db28320f83bbb7e23f2d8c043d75b688977 Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 27 Feb 2024 14:02:40 +0800 Subject: [PATCH 2/2] Depends on `AbpVirtualFileSystemModule`. --- docs/en/API/Static-CSharp-API-Clients.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/en/API/Static-CSharp-API-Clients.md b/docs/en/API/Static-CSharp-API-Clients.md index bcbe7d3606..5bcbc252c7 100644 --- a/docs/en/API/Static-CSharp-API-Clients.md +++ b/docs/en/API/Static-CSharp-API-Clients.md @@ -65,8 +65,9 @@ Now, it's ready to configure the application for the static client proxy generat ````csharp [DependsOn( - typeof(AbpHttpClientModule) //used to create client proxies - )] + typeof(AbpHttpClientModule), //used to create client proxies + typeof(AbpVirtualFileSystemModule) //virtual file system +)] public class MyClientAppModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) @@ -90,8 +91,9 @@ public class MyClientAppModule : AbpModule ````csharp [DependsOn( typeof(AbpHttpClientModule), //used to create client proxies + typeof(AbpVirtualFileSystemModule), //virtual file system typeof(BookStoreApplicationContractsModule) //contains the application service interfaces - )] +)] public class MyClientAppModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context)