]> git.deb.at Git - rhonda/impostor.git/commitdiff
Fix AppVeyor and pluginloader issue
authorAeonLucid <aeonlucid@outlook.com>
Sat, 24 Oct 2020 18:18:40 +0000 (20:18 +0200)
committerAeonLucid <aeonlucid@outlook.com>
Sat, 24 Oct 2020 18:18:40 +0000 (20:18 +0200)
build.cake
src/Impostor.Server/Plugins/PluginLoader.cs

index 5fabff445f48bac1846dfc4673dd61a2b125b5cd..f15a90ee8cd6215d900892ece4bcdb94a613ddbe 100644 (file)
@@ -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);
 }
index 9705567c8f843493aabc5b948087fc4fc4b97d9d..29f36510dc1ab3513f472c599ac44935c9da6ac0 100644 (file)
@@ -22,12 +22,10 @@ namespace Impostor.Server.Plugins
             var pluginPaths = new List<string>(config.Paths);
             var libraryPaths = new List<string>(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<PluginInformation>();