diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2016-11-27 15:56:47 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2016-11-27 15:56:47 -0500 |
commit | f7b8879011873fa8f7a3d5dd7db27254bfc90469 (patch) | |
tree | 7c4e42901614ede42621fd4265c89e131eea4f19 /src/StardewModdingAPI/Program.cs | |
parent | 0d94c628bbc1d1ab098e0a90ee5758ee69694887 (diff) | |
download | SMAPI-f7b8879011873fa8f7a3d5dd7db27254bfc90469.tar.gz SMAPI-f7b8879011873fa8f7a3d5dd7db27254bfc90469.tar.bz2 SMAPI-f7b8879011873fa8f7a3d5dd7db27254bfc90469.zip |
supplement assembly resolution for Mono (#166)
Diffstat (limited to 'src/StardewModdingAPI/Program.cs')
-rw-r--r-- | src/StardewModdingAPI/Program.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/StardewModdingAPI/Program.cs b/src/StardewModdingAPI/Program.cs index eba89981..bed4cafc 100644 --- a/src/StardewModdingAPI/Program.cs +++ b/src/StardewModdingAPI/Program.cs @@ -303,6 +303,8 @@ namespace StardewModdingAPI Program.Monitor.Log("Loading mods..."); ModAssemblyLoader modAssemblyLoader = new ModAssemblyLoader(Program.CachePath, Program.TargetPlatform, Program.Monitor); + AppDomain.CurrentDomain.AssemblyResolve += (sender, e) => modAssemblyLoader.ResolveAssembly(e.Name); // supplement Mono's assembly resolution which doesn't handle assembly rewrites very well + foreach (string directory in Directory.GetDirectories(Program.ModPath)) { // ignore internal directory @@ -391,7 +393,7 @@ namespace StardewModdingAPI } catch (Exception ex) { - Program.Monitor.Log($"{errorPrefix}: couldm't create the per-save configuration directory ('psconfigs') requested by this mod.\n{ex.GetLogSummary()}", LogLevel.Error); + Program.Monitor.Log($"{errorPrefix}: couldn't create the per-save configuration directory ('psconfigs') requested by this mod.\n{ex.GetLogSummary()}", LogLevel.Error); continue; } } |