From fd11bc57475e72097916a866b423efd1740c1982 Mon Sep 17 00:00:00 2001 From: iioter <535915157@qq.com> Date: Thu, 2 Jun 2022 14:40:24 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A9=B1=E5=8A=A8=E5=8A=A0=E8=BD=BD=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Plugins/Plugin/DrvierService.cs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Plugins/Plugin/DrvierService.cs b/Plugins/Plugin/DrvierService.cs index bf0dec9..a1db1b8 100644 --- a/Plugins/Plugin/DrvierService.cs +++ b/Plugins/Plugin/DrvierService.cs @@ -116,10 +116,10 @@ namespace Plugin } public void LoadAllDrivers() { - try + _logger.LogInformation("LoadAllDrivers Start"); + foreach (var file in driverFiles) { - _logger.LogInformation("LoadAllDrivers Start"); - foreach (var file in driverFiles) + try { var dll = Assembly.LoadFrom(file); foreach (var type in dll.GetTypes().Where(x => typeof(IDriver).IsAssignableFrom(x) && x.IsClass)) @@ -130,14 +130,16 @@ namespace Plugin Type = type }; DriverInfos.Add(driverInfo); + _logger.LogInformation($"LoadAllDrivers {driverInfo.FileName} OK"); } } - _logger.LogInformation($"LoadAllDrivers End,Count{DriverInfos.Count}"); - } - catch (Exception ex) - { - _logger.LogError("LoadAllDrivers Error,一般是驱动项目引用的nuget或dll没有复制到驱动文件夹", ex); + catch (Exception ex) + { + _logger.LogDebug($"LoadAllDrivers Error {ex}"); + } + } + _logger.LogInformation($"LoadAllDrivers End,Count{DriverInfos.Count}"); }