@@ -55,7 +55,7 @@ public static List<PluginPair> Plugins(List<PluginMetadata> metadatas, PluginsSe
5555 return plugins ;
5656 }
5757
58- private static IEnumerable < PluginPair > DotNetPlugins ( List < PluginMetadata > source )
58+ private static List < PluginPair > DotNetPlugins ( List < PluginMetadata > source )
5959 {
6060 var erroredPlugins = new List < string > ( ) ;
6161
@@ -65,54 +65,54 @@ private static IEnumerable<PluginPair> DotNetPlugins(List<PluginMetadata> source
6565 foreach ( var metadata in metadatas )
6666 {
6767 var milliseconds = API . StopwatchLogDebug ( ClassName , $ "Constructor init cost for { metadata . Name } ", ( ) =>
68- {
69- Assembly assembly = null ;
70- IAsyncPlugin plugin = null ;
68+ {
69+ Assembly assembly = null ;
70+ IAsyncPlugin plugin = null ;
7171
72- try
73- {
74- var assemblyLoader = new PluginAssemblyLoader ( metadata . ExecuteFilePath ) ;
75- assembly = assemblyLoader . LoadAssemblyAndDependencies ( ) ;
72+ try
73+ {
74+ var assemblyLoader = new PluginAssemblyLoader ( metadata . ExecuteFilePath ) ;
75+ assembly = assemblyLoader . LoadAssemblyAndDependencies ( ) ;
7676
77- var type = assemblyLoader . FromAssemblyGetTypeOfInterface ( assembly ,
78- typeof ( IAsyncPlugin ) ) ;
77+ var type = assemblyLoader . FromAssemblyGetTypeOfInterface ( assembly ,
78+ typeof ( IAsyncPlugin ) ) ;
7979
80- plugin = Activator . CreateInstance ( type ) as IAsyncPlugin ;
80+ plugin = Activator . CreateInstance ( type ) as IAsyncPlugin ;
8181
82- metadata . AssemblyName = assembly . GetName ( ) . Name ;
83- }
82+ metadata . AssemblyName = assembly . GetName ( ) . Name ;
83+ }
8484#if DEBUG
85- catch ( Exception )
86- {
87- throw ;
88- }
85+ catch ( Exception )
86+ {
87+ throw ;
88+ }
8989#else
90- catch ( Exception e ) when ( assembly == null )
91- {
92- Log . Exception ( ClassName , $ "Couldn't load assembly for the plugin: { metadata . Name } ", e ) ;
93- }
94- catch ( InvalidOperationException e )
95- {
96- Log . Exception ( ClassName , $ "Can't find the required IPlugin interface for the plugin: <{ metadata . Name } >", e ) ;
97- }
98- catch ( ReflectionTypeLoadException e )
99- {
100- Log . Exception ( ClassName , $ "The GetTypes method was unable to load assembly types for the plugin: <{ metadata . Name } >", e ) ;
101- }
102- catch ( Exception e )
103- {
104- Log . Exception ( ClassName , $ "The following plugin has errored and can not be loaded: <{ metadata . Name } >", e ) ;
105- }
90+ catch ( Exception e ) when ( assembly == null )
91+ {
92+ Log . Exception ( ClassName , $ "Couldn't load assembly for the plugin: { metadata . Name } ", e ) ;
93+ }
94+ catch ( InvalidOperationException e )
95+ {
96+ Log . Exception ( ClassName , $ "Can't find the required IPlugin interface for the plugin: <{ metadata . Name } >", e ) ;
97+ }
98+ catch ( ReflectionTypeLoadException e )
99+ {
100+ Log . Exception ( ClassName , $ "The GetTypes method was unable to load assembly types for the plugin: <{ metadata . Name } >", e ) ;
101+ }
102+ catch ( Exception e )
103+ {
104+ Log . Exception ( ClassName , $ "The following plugin has errored and can not be loaded: <{ metadata . Name } >", e ) ;
105+ }
106106#endif
107107
108- if ( plugin == null )
109- {
110- erroredPlugins . Add ( metadata . Name ) ;
111- return ;
112- }
108+ if ( plugin == null )
109+ {
110+ erroredPlugins . Add ( metadata . Name ) ;
111+ return ;
112+ }
113113
114- plugins . Add ( new PluginPair { Plugin = plugin , Metadata = metadata } ) ;
115- } ) ;
114+ plugins . Add ( new PluginPair { Plugin = plugin , Metadata = metadata } ) ;
115+ } ) ;
116116 metadata . InitTime += milliseconds ;
117117 }
118118
0 commit comments