Shunnet 2 лет назад
Родитель
Сommit
5aa2b4c778

+ 6 - 1
src/YSAI.DAQ/YSAI.DaqManage/DaqManageOperate.cs

@@ -391,12 +391,17 @@ namespace YSAI.DaqManage
                         typesArray.Add(type);
                         typesArray.Add(type);
                     }
                     }
                 }
                 }
+                bool iocState = false;
                 //添加至集合
                 //添加至集合
                 foreach (Type type in typesArray)
                 foreach (Type type in typesArray)
                 {
                 {
                     TypeIoc.TryAdd(type.FullName, type);
                     TypeIoc.TryAdd(type.FullName, type);
-                    //抛出信息
                     OnEventHandler?.Invoke(this, new EventResult(true, $"{type.FullName} 程序集添加成功"));
                     OnEventHandler?.Invoke(this, new EventResult(true, $"{type.FullName} 程序集添加成功"));
+                    iocState = true;
+                }
+                if (!iocState)
+                {
+                    OnEventHandler?.Invoke(this, new EventResult(false, $"{assembly.FullName}程序集中未找到继承{InterfaceFullName}此接口的类"));
                 }
                 }
             }
             }
             catch (Exception)
             catch (Exception)

+ 6 - 1
src/YSAI.DAQ/YSAI.RelayManage/RelayManageOperate.cs

@@ -422,12 +422,17 @@ namespace YSAI.RelayManage
                         typesArray.Add(type);
                         typesArray.Add(type);
                     }
                     }
                 }
                 }
+                bool iocState = false;
                 //添加至集合
                 //添加至集合
                 foreach (Type type in typesArray)
                 foreach (Type type in typesArray)
                 {
                 {
                     TypeIoc.TryAdd(type.FullName, type);
                     TypeIoc.TryAdd(type.FullName, type);
-                    //抛出信息
                     OnEventHandler?.Invoke(this, new EventResult(true, $"{type.FullName} 程序集添加成功"));
                     OnEventHandler?.Invoke(this, new EventResult(true, $"{type.FullName} 程序集添加成功"));
+                    iocState = true;
+                }
+                if (!iocState)
+                {
+                    OnEventHandler?.Invoke(this, new EventResult(false, $"{assembly.FullName}程序集中未找到继承{InterfaceFullName}此接口的类"));
                 }
                 }
             }
             }
             catch (Exception)
             catch (Exception)