From 2c1619de6ffaec5189bbac8e842ea4d617b3de86 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Thu, 23 Nov 2023 09:37:46 +0800 Subject: [PATCH] Update AppTemplateChangeConsoleTestClientPortSettingsStep.cs --- ...TemplateChangeConsoleTestClientPortSettingsStep.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateChangeConsoleTestClientPortSettingsStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateChangeConsoleTestClientPortSettingsStep.cs index b37736696f0..76a4ddc042b 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateChangeConsoleTestClientPortSettingsStep.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateChangeConsoleTestClientPortSettingsStep.cs @@ -20,9 +20,12 @@ public AppTemplateChangeConsoleTestClientPortSettingsStep( public override void Execute(ProjectBuildContext context) { - context - .GetFile("/aspnet-core/test/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp/appsettings.json") - .ReplaceText("44300", RemoteServicePort) - .ReplaceText("44301", AuthServerPort); + var appsettingsFile = context.FindFile("/aspnet-core/test/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp/appsettings.json"); + + if(appsettingsFile != null) + { + appsettingsFile.ReplaceText("44300", RemoteServicePort); + appsettingsFile.ReplaceText("44301", AuthServerPort); + } } }