Hotfixes bad IL image

This commit is contained in:
Kamron Batman 2020-05-08 21:24:40 -07:00
parent 4b497372e0
commit 0140eb73b4
No known key found for this signature in database
GPG key ID: 5C9DFD15804B6BB8

View file

@ -37,7 +37,17 @@ namespace Server
public static void LoadScripts(string path = null) =>
Assemblies = Directory.GetFiles(path ?? AssembliesPath, "*.dll")
.Select(t => AssemblyLoadContext.Default.LoadFromAssemblyPath(t)).ToArray();
.Select(t =>
{
try
{
return AssemblyLoadContext.Default.LoadFromAssemblyPath(t);
} catch (BadImageFormatException)
{
// ignored
return null;
}
}).Where(t => t != null).ToArray();
public static void Invoke(string method)
{