Fix DarkTardMissingNamespacePatch, add some compiler stuff from normal plugin loader, and some code cleanup

This commit is contained in:
2023-07-03 16:23:42 -04:00
parent 856e7dce59
commit 40fa225b1c
11 changed files with 57 additions and 25 deletions

View File

@@ -43,6 +43,12 @@ public static class RoslynReferences
AddAssemblyReference(a);
sb.AppendLine(a.FullName);
}
foreach(var a in GetOtherReferences())
{
AddAssemblyReference(a);
sb.AppendLine(a.FullName);
}
sb.AppendLine(line);
while (loadedAssemblies.Count > 0)
@@ -77,6 +83,14 @@ public static class RoslynReferences
LogFile.WriteLine(sb.ToString(), false);
}
/// <summary>
/// This method is used to load references that otherwise would not exist or be optimized out
/// </summary>
private static IEnumerable<Assembly> GetOtherReferences()
{
yield return typeof(Microsoft.CSharp.RuntimeBinder.Binder).Assembly;
}
private static bool ContainsReference(AssemblyName name)
{