@@ -55,7 +55,7 @@ public static List<PluginPair> Plugins(List<PluginMetadata> metadatas, PluginsSe
55
55
return plugins ;
56
56
}
57
57
58
- private static IEnumerable < PluginPair > DotNetPlugins ( List < PluginMetadata > source )
58
+ private static List < PluginPair > DotNetPlugins ( List < PluginMetadata > source )
59
59
{
60
60
var erroredPlugins = new List < string > ( ) ;
61
61
@@ -65,54 +65,54 @@ private static IEnumerable<PluginPair> DotNetPlugins(List<PluginMetadata> source
65
65
foreach ( var metadata in metadatas )
66
66
{
67
67
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 ;
71
71
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 ( ) ;
76
76
77
- var type = assemblyLoader . FromAssemblyGetTypeOfInterface ( assembly ,
78
- typeof ( IAsyncPlugin ) ) ;
77
+ var type = assemblyLoader . FromAssemblyGetTypeOfInterface ( assembly ,
78
+ typeof ( IAsyncPlugin ) ) ;
79
79
80
- plugin = Activator . CreateInstance ( type ) as IAsyncPlugin ;
80
+ plugin = Activator . CreateInstance ( type ) as IAsyncPlugin ;
81
81
82
- metadata . AssemblyName = assembly . GetName ( ) . Name ;
83
- }
82
+ metadata . AssemblyName = assembly . GetName ( ) . Name ;
83
+ }
84
84
#if DEBUG
85
- catch ( Exception )
86
- {
87
- throw ;
88
- }
85
+ catch ( Exception )
86
+ {
87
+ throw ;
88
+ }
89
89
#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
+ }
106
106
#endif
107
107
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
+ }
113
113
114
- plugins . Add ( new PluginPair { Plugin = plugin , Metadata = metadata } ) ;
115
- } ) ;
114
+ plugins . Add ( new PluginPair { Plugin = plugin , Metadata = metadata } ) ;
115
+ } ) ;
116
116
metadata . InitTime += milliseconds ;
117
117
}
118
118
0 commit comments