From 2fd272755a356087f2846a5658f1755c86193894 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Thu, 13 Jun 2019 14:13:48 +0300 Subject: [PATCH] Bug fix on random port generation --- .../Cli/ProjectBuilding/Templates/TemplateRandomSslPortStep.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/TemplateRandomSslPortStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/TemplateRandomSslPortStep.cs index f363e2c31b..009c2cf928 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/TemplateRandomSslPortStep.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/TemplateRandomSslPortStep.cs @@ -33,7 +33,6 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates !x.IsDirectory && x.Name.EndsWith("appSettings.json", StringComparison.InvariantCultureIgnoreCase)) .ToList(); - var excludePorts = new List(); excludePorts.AddRange(_buildInSslUrls.Select(GetUrlPort).ToList()); @@ -85,7 +84,7 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates private string GetRandomPort(IReadOnlyCollection excludePort = null) { - var ports = Enumerable.Range(_minSslPort, _maxSslPort).Select(p => p.ToString()); + var ports = Enumerable.Range(_minSslPort, _maxSslPort - _minSslPort + 1).Select(p => p.ToString()); return RandomHelper.GetRandomOfList(excludePort != null ? ports.Except(excludePort).ToList()