From ff5c55d8a206a623f16267a1ce160b0790c2e790 Mon Sep 17 00:00:00 2001 From: Alper Ebicoglu Date: Tue, 14 Apr 2020 14:35:23 +0300 Subject: [PATCH] closes #3601 --- .../ProjectBuilding/TemplateProjectBuilder.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateProjectBuilder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateProjectBuilder.cs index dffb8be0d6..e8ddc804c2 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateProjectBuilder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateProjectBuilder.cs @@ -60,10 +60,22 @@ namespace Volo.Abp.Cli.ProjectBuilding args.TemplateSource ); - DeveloperApiKeyResult apiKeyResult; + DeveloperApiKeyResult apiKeyResult = null; #if DEBUG - apiKeyResult = _configuration.GetSection("apiKeyResult").Get(); //you can use user secrets + try + { + var apiKeyResultSection = _configuration.GetSection("apiKeyResult"); + if (apiKeyResultSection.Exists()) + { + apiKeyResult = apiKeyResultSection.Get(); //you can use user secrets + } + } + catch (Exception e) + { + Console.WriteLine(e); + } + if (apiKeyResult == null) { apiKeyResult = await ApiKeyService.GetApiKeyOrNullAsync();