mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-22 19:15:34 +00:00
Disable loading of additional assemblies in AOT context (#314)
* Disable loading of additional assemblies in AOT context AOT does not supports `Assembly.Load` and `Assembly.GetReferencedAssemblies()` when running AOT. I opt-out of code which try to find type. In AOT context this means that you rely on dynamic type loading and you have issues anyway. * Fix compilation errors
This commit is contained in:
parent
42ceb1c0d1
commit
0b3795eb87
|
@ -28,6 +28,7 @@ namespace GLib {
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
|
@ -238,7 +239,11 @@ namespace GLib {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result == null) {
|
if (result == null
|
||||||
|
#if NET6_0_OR_GREATER
|
||||||
|
&& RuntimeFeature.IsDynamicCodeSupported
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
// Because of lazy loading of references, it's possible the type's assembly
|
// Because of lazy loading of references, it's possible the type's assembly
|
||||||
// needs to be loaded. We will look for it by name in the references of
|
// needs to be loaded. We will look for it by name in the references of
|
||||||
// the currently loaded assemblies. Hopefully a recursive traversal is
|
// the currently loaded assemblies. Hopefully a recursive traversal is
|
||||||
|
|
Loading…
Reference in a new issue