diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlingService.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlingService.cs index 9b0729b000..3552c09a72 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlingService.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlingService.cs @@ -180,12 +180,19 @@ namespace Volo.Abp.Cli.Bundling int level, List bundleDefinitions) { - var bundleContributer = module.Assembly + var bundleContributers = module.Assembly .GetTypes() - .SingleOrDefault(t => t.IsAssignableTo()); + .Where(t => t.IsAssignableTo()) + .ToList(); - if (bundleContributer != null) + if (bundleContributers.Count > 1) { + throw new BundlingException($"Each project must contain only one class implementing {nameof(IBundleContributor)}"); + } + + if (bundleContributers.Any()) + { + var bundleContributer = bundleContributers[0]; var definition = bundleDefinitions.SingleOrDefault(t => t.BundleContributerType == bundleContributer); if (definition != null) {