|
@@ -4,7 +4,9 @@ using Serilog.Events;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Diagnostics;
|
|
|
+using System.IO;
|
|
|
using System.Linq;
|
|
|
+using System.Reflection;
|
|
|
using System.Text;
|
|
|
using System.Threading;
|
|
|
using System.Threading.Tasks;
|
|
@@ -13,6 +15,25 @@ namespace XdCxRhDW.Framework
|
|
|
{
|
|
|
public static class LogHelper
|
|
|
{
|
|
|
+ static LogHelper()
|
|
|
+ {
|
|
|
+ AppDomain.CurrentDomain.AssemblyResolve += (sender, args) =>
|
|
|
+ {
|
|
|
+ string path1 = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "AddIns");
|
|
|
+ string path2 = AppDomain.CurrentDomain.BaseDirectory;
|
|
|
+ string dll1 = Path.Combine(path1, args.Name.Split(',')[0] + ".dll");
|
|
|
+ string dll2 = Path.Combine(path2, args.Name.Split(',')[0] + ".dll");
|
|
|
+ if (File.Exists(dll1))
|
|
|
+ {
|
|
|
+ return Assembly.LoadFrom(dll1);
|
|
|
+ }
|
|
|
+ if (File.Exists(dll2))
|
|
|
+ {
|
|
|
+ return Assembly.LoadFrom(dll2);
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ };
|
|
|
+ }
|
|
|
private static bool _hasBuild = false;
|
|
|
public static void BuildLogger(bool usePID = true)
|
|
|
{
|