Preload assembly for dynamic support in editor

This commit is contained in:
2026-07-30 22:02:53 -05:00
parent 4d589314c8
commit 04d0608e60
+3
View File
@@ -1758,6 +1758,9 @@ namespace FlaxEngine.Interop
assembly.GetType("System.Linq.Expressions.Compiler.DelegateHelpers")
.GetMethod("MakeNewCustomDelegate", BindingFlags.NonPublic | BindingFlags.Static).CreateDelegate<Func<Type[], Type>>();
// Load Microsoft.CSharp assembly into collectible ALC for dynamic binder support
scriptingAssemblyLoadContext.LoadFromAssemblyPath(typeof(Microsoft.CSharp.RuntimeBinder.Binder).Assembly.Location);
// Create dummy delegates to force the dynamic Snippets assembly to be loaded in correcet ALCs
MakeNewCustomDelegateFunc(new[] { typeof(void) });
{