public void InitPluginFinder() { string searchPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); // Load plugins from all dlls in the startup directory foreach (var file in Directory.GetFiles(searchPath, "*.dll")) { try { PluginFinder.LoadTypesFromAssembly(Assembly.LoadFile(file)); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("Error loading assembly: " + ex.Message); } } }