From: AeonLucid Date: Sat, 24 Oct 2020 18:18:40 +0000 (+0200) Subject: Fix AppVeyor and pluginloader issue X-Git-Tag: v1.2.2~96^2~14 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=150dbdefaac3e2d23bdf2287ebc83dca15122961;p=rhonda%2Fimpostor.git Fix AppVeyor and pluginloader issue --- diff --git a/build.cake b/build.cake index 5fabff4..f15a90e 100644 --- a/build.cake +++ b/build.cake @@ -21,7 +21,7 @@ if (buildBranch != "master") { // Remove unnecessary files for packaging. private void ImpostorClean(string directory) { foreach (var file in System.IO.Directory.GetFiles(directory, "*.pdb", SearchOption.AllDirectories)) { - DeleteFile(file); + System.IO.File.Delete(file); } } @@ -40,7 +40,7 @@ private void ImpostorPublish(string name, string project, string runtime) { OutputDirectory = projBuildDir }); - ImpostorClean(projBuildDir); + ImpostorClean(projBuildDir.ToString()); Zip(projBuildDir, projBuildZip); } @@ -57,7 +57,7 @@ private void ImpostorPublishNF(string name, string project) { OutputDirectory = projBuildDir }); - ImpostorClean(projBuildDir); + ImpostorClean(projBuildDir.ToString()); Zip(projBuildDir, projBuildZip); } diff --git a/src/Impostor.Server/Plugins/PluginLoader.cs b/src/Impostor.Server/Plugins/PluginLoader.cs index 9705567..29f3651 100644 --- a/src/Impostor.Server/Plugins/PluginLoader.cs +++ b/src/Impostor.Server/Plugins/PluginLoader.cs @@ -22,12 +22,10 @@ namespace Impostor.Server.Plugins var pluginPaths = new List(config.Paths); var libraryPaths = new List(config.LibraryPaths); - var rootFolder = Assembly.GetEntryAssembly()?.Location; - if (rootFolder != null) - { - pluginPaths.Add(Path.Combine(rootFolder, "plugins")); - libraryPaths.Add(Path.Combine(rootFolder, "libraries")); - } + var rootFolder = AppContext.BaseDirectory; + + pluginPaths.Add(Path.Combine(rootFolder, "plugins")); + libraryPaths.Add(Path.Combine(rootFolder, "libraries")); var matcher = new Matcher(StringComparison.OrdinalIgnoreCase); matcher.AddInclude("*.dll"); @@ -51,7 +49,6 @@ namespace Impostor.Server.Plugins .Select(a => context.LoadFromAssemblyName(a.AssemblyName)) .ToList(); - // Find all plugins. var plugins = new List();