From dce06db36277fb0e323e5c9f68f6382233a0a84f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Guadalupe=20Nava=20Zavala?= Date: Sat, 2 May 2020 03:27:08 -0500 Subject: [PATCH] Fix build problem Fix trying to access field in a string. Changed Toolbox references to automatically build dependencies (Toolbox_Library, File_Format_Library) to resepective output folder --- Switch_Toolbox_Library/Plugin/PluginLoader.cs | 11 +++++++++-- Toolbox/MainForm.cs | 4 ++-- Toolbox/Toolbox.csproj | 6 +++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Switch_Toolbox_Library/Plugin/PluginLoader.cs b/Switch_Toolbox_Library/Plugin/PluginLoader.cs index 272930f0..fe7ce028 100644 --- a/Switch_Toolbox_Library/Plugin/PluginLoader.cs +++ b/Switch_Toolbox_Library/Plugin/PluginLoader.cs @@ -91,8 +91,15 @@ namespace Toolbox.Library ICollection plugins = new List(pluginTypes.Count); foreach (Type type in pluginTypes) { - IPlugin plugin = (IPlugin)Activator.CreateInstance(type); - plugins.Add(plugin); + try + { + IPlugin plugin = (IPlugin)Activator.CreateInstance(type); + plugins.Add(plugin); + } + catch (Exception ex) + { + Console.Error.WriteLine("Couldn't Load {0} Reason:{1}", type, ex.Message); + } } assemblies.Clear(); pluginTypes.Clear(); diff --git a/Toolbox/MainForm.cs b/Toolbox/MainForm.cs index 6496f8cc..b905ab3d 100644 --- a/Toolbox/MainForm.cs +++ b/Toolbox/MainForm.cs @@ -1401,7 +1401,7 @@ namespace Toolbox } catch (Exception ex) { - failedFiles.Add($"{file.Filename} \n Error:\n {ex} \n"); + failedFiles.Add($"{file} \n Error:\n {ex} \n"); } SearchFileFormat(form.BatchSettings, fileFormat, extension, outputFolder, ExportMode.Models); @@ -1448,7 +1448,7 @@ namespace Toolbox } catch (Exception ex) { - failedFiles.Add($"{file.Filename} \n Error:\n {ex} \n"); + failedFiles.Add($"{file} \n Error:\n {ex} \n"); } SearchFileFormat(form.BatchSettings, fileFormat, extension, outputFolder, ExportMode.Textures); diff --git a/Toolbox/Toolbox.csproj b/Toolbox/Toolbox.csproj index 10c7606c..ce2a525a 100644 --- a/Toolbox/Toolbox.csproj +++ b/Toolbox/Toolbox.csproj @@ -367,9 +367,9 @@ - - {fa690685-3370-44d5-b138-f538c8d4c2a3} - BrawlboxHelper + + {a11705cf-a6a3-41c3-875a-e1cfd8080f09} + File_Format_Library {96820047-2a39-4e5a-bfa4-e84fff5c66cf}