@@ -44,23 +44,23 @@ public static IEnumerable<PluginPair> DotNetPlugins(List<PluginMetadata> source)
4444#if DEBUG
4545 var assemblyLoader = new PluginAssemblyLoader ( metadata . ExecuteFilePath ) ;
4646 var assembly = assemblyLoader . LoadAssemblyAndDependencies ( ) ;
47- var type = assemblyLoader . FromAssemblyGetTypeOfInterface ( assembly , typeof ( IPlugin ) ,
47+ var type = assemblyLoader . FromAssemblyGetTypeOfInterface ( assembly ,
4848 typeof ( IAsyncPlugin ) ) ;
4949
50- var plugin = Activator . CreateInstance ( type ) ;
50+ var plugin = Activator . CreateInstance ( type ) as IAsyncPlugin ;
5151#else
5252 Assembly assembly = null ;
53- object plugin = null ;
53+ IAsyncPlugin plugin = null ;
5454
5555 try
5656 {
5757 var assemblyLoader = new PluginAssemblyLoader ( metadata . ExecuteFilePath ) ;
5858 assembly = assemblyLoader . LoadAssemblyAndDependencies ( ) ;
5959
60- var type = assemblyLoader . FromAssemblyGetTypeOfInterface ( assembly , typeof ( IPlugin ) ,
60+ var type = assemblyLoader . FromAssemblyGetTypeOfInterface ( assembly ,
6161 typeof ( IAsyncPlugin ) ) ;
6262
63- plugin = Activator . CreateInstance ( type ) ;
63+ plugin = Activator . CreateInstance ( type ) as IAsyncPlugin ;
6464 }
6565 catch ( Exception e ) when ( assembly == null )
6666 {
@@ -78,13 +78,13 @@ public static IEnumerable<PluginPair> DotNetPlugins(List<PluginMetadata> source)
7878 {
7979 Log . Exception ( $ "|PluginsLoader.DotNetPlugins|The following plugin has errored and can not be loaded: <{ metadata . Name } >", e ) ;
8080 }
81-
81+ #endif
8282 if ( plugin == null )
8383 {
8484 erroredPlugins . Add ( metadata . Name ) ;
8585 return ;
8686 }
87- #endif
87+
8888 plugins . Add ( new PluginPair
8989 {
9090 Plugin = plugin ,
@@ -139,7 +139,7 @@ public static IEnumerable<PluginPair> PythonPlugins(List<PluginMetadata> source,
139139 }
140140 else
141141 {
142- Log . Error ( "PluginsLoader" , "Failed to set Python path despite the environment variable PATH is found" , "PythonPlugins" ) ;
142+ Log . Error ( "PluginsLoader" , "Failed to set Python path despite the environment variable PATH is found" , "PythonPlugins" ) ;
143143 }
144144 }
145145 }
@@ -152,7 +152,7 @@ public static IEnumerable<PluginPair> PythonPlugins(List<PluginMetadata> source,
152152 }
153153 else
154154 {
155- Log . Error ( "PluginsLoader" , $ "Tried to automatically set from Settings.PythonDirectory " +
155+ Log . Error ( "PluginsLoader" , $ "Tried to automatically set from Settings.PythonDirectory " +
156156 $ "but can't find python executable in { path } ", "PythonPlugins" ) ;
157157 }
158158 }
@@ -205,7 +205,7 @@ public static IEnumerable<PluginPair> PythonPlugins(List<PluginMetadata> source,
205205 }
206206 else
207207 {
208- Log . Error ( "PluginsLoader" ,
208+ Log . Error ( "PluginsLoader" ,
209209 $ "Failed to set Python path after Droplex install, { pythonPath } does not exist",
210210 "PythonPlugins" ) ;
211211 }
@@ -215,8 +215,8 @@ public static IEnumerable<PluginPair> PythonPlugins(List<PluginMetadata> source,
215215 if ( string . IsNullOrEmpty ( settings . PythonDirectory ) )
216216 {
217217 MessageBox . Show ( "Unable to set Python executable path, please try from Flow's settings (scroll down to the bottom)." ) ;
218- Log . Error ( "PluginsLoader" ,
219- $ "Not able to successfully set Python path, the PythonDirectory variable is still an empty string.",
218+ Log . Error ( "PluginsLoader" ,
219+ $ "Not able to successfully set Python path, the PythonDirectory variable is still an empty string.",
220220 "PythonPlugins" ) ;
221221
222222 return new List < PluginPair > ( ) ;
0 commit comments