From ebfd4fd457dc07da89ad37cab3094ce7d6c429c8 Mon Sep 17 00:00:00 2001 From: TheSpydog Date: Mon, 22 Aug 2022 16:43:19 +0000 Subject: [PATCH] Ignore dllmap logic when running under NativeAOT (#23) Co-authored-by: Caleb Cornett Reviewed-on: https://gitea.moonside.games/MoonsideGames/MoonWorks/pulls/23 Co-authored-by: TheSpydog Co-committed-by: TheSpydog --- src/MoonWorksDllMap.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/MoonWorksDllMap.cs b/src/MoonWorksDllMap.cs index 2e62864..c030adb 100644 --- a/src/MoonWorksDllMap.cs +++ b/src/MoonWorksDllMap.cs @@ -84,6 +84,12 @@ namespace MoonWorks [ModuleInitializer] public static void Init() { + // Ignore NativeAOT platforms since they don't perform dynamic loading. + if (!RuntimeFeature.IsDynamicCodeSupported) + { + return; + } + // Get the platform and architecture string os = GetPlatformName(); string cpu = RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant();