Ignore dllmap logic when running under NativeAOT

pull/23/head
Caleb Cornett 2022-08-21 21:36:00 -04:00
parent b380707462
commit c0998f219e
1 changed files with 6 additions and 0 deletions

View File

@ -84,6 +84,12 @@ namespace MoonWorks
[ModuleInitializer] [ModuleInitializer]
public static void Init() public static void Init()
{ {
// Ignore NativeAOT platforms since they don't perform dynamic loading.
if (!RuntimeFeature.IsDynamicCodeSupported)
{
return;
}
// Get the platform and architecture // Get the platform and architecture
string os = GetPlatformName(); string os = GetPlatformName();
string cpu = RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); string cpu = RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant();