diff --git a/src/MicroBatchFramework/BatchEngineHostBuilderExtensions.cs b/src/MicroBatchFramework/BatchEngineHostBuilderExtensions.cs index 90d598e..6f763a4 100644 --- a/src/MicroBatchFramework/BatchEngineHostBuilderExtensions.cs +++ b/src/MicroBatchFramework/BatchEngineHostBuilderExtensions.cs @@ -217,6 +217,10 @@ static List GetBatchTypes() { if (cmdattr.CommandNames.Any(x => arg0.Equals(x, StringComparison.OrdinalIgnoreCase))) { + if(foundType != null && foundMethod != null) + { + throw new InvalidOperationException($"Duplicate BatchBase Command name is not allowed, {foundType.FullName}.{foundMethod.Name} and {baseType.FullName}.{method.Name}"); + } foundType = baseType; foundMethod = method; isFound = true;