diff --git a/JiShe.CollectBus.Console/Extensions/DependencyInjections/DependencyInjectionExtensions.cs b/JiShe.CollectBus.Console/Extensions/DependencyInjections/DependencyInjectionExtensions.cs index d68f636..6fffdb6 100644 --- a/JiShe.CollectBus.Console/Extensions/DependencyInjections/DependencyInjectionExtensions.cs +++ b/JiShe.CollectBus.Console/Extensions/DependencyInjections/DependencyInjectionExtensions.cs @@ -12,7 +12,7 @@ namespace Microsoft.Extensions.DependencyInjection { public static class DependencyInjectionExtensions { - public static void ServiceRegister(this IServiceCollection services,params Assembly[] assemblies) + public static void ServiceRegister(this IServiceCollection services, params Assembly[] assemblies) { if (assemblies.Length <= 0) { @@ -61,7 +61,7 @@ namespace Microsoft.Extensions.DependencyInjection } } - public static void PluginServiceRegister(this IServiceCollection services,string pluginPath="") + public static void PluginServiceRegister(this IServiceCollection services, string pluginPath = "") { if (pluginPath.IsNullOrWhiteSpace()) { @@ -74,6 +74,8 @@ namespace Microsoft.Extensions.DependencyInjection public static IEnumerable GetAssembliesFromFolder(string folderPath) { var directory = new DirectoryInfo(folderPath); + if (!directory.Exists) return Enumerable.Empty(); + var files = directory.GetFiles("*.dll"); var assemblies = new List();