NeosModLoader icon indicating copy to clipboard operation
NeosModLoader copied to clipboard

BadImageFormatException loading unmanged DLL from nml_libs

Open zkxs opened this issue 2 years ago • 0 comments

12:40:26 PM.941 (  0 FPS)	[INFO] [NeosModLoader] loading assemblies from nml_libs
12:40:27 PM.497 (  0 FPS)	[ERROR][NeosModLoader] error loading assembly from D:\Neos\app\nml_libs\Magick.Native-Q16-x64.dll: System.BadImageFormatException: 
File name: 'D:\Neos\app\nml_libs\Magick.Native-Q16-x64.dll'
  at (wrapper managed-to-native) System.Reflection.Assembly.LoadFrom(string,bool)
  at System.Reflection.Assembly.LoadFrom (System.String assemblyFile) [0x00000] in <9577ac7a62ef43179789031239ba8798>:0 
  at NeosModLoader.AssemblyLoader.LoadAssembly (System.String filepath) [0x00039] in <12833d5d0793412ca8252021544de084>:0 
12:40:27 PM.612 (  0 FPS)	[ERROR][NeosModLoader] error loading assembly from D:\Neos\app\nml_libs\git2-106a5f2.dll: System.BadImageFormatException: 
File name: 'D:\Neos\app\nml_libs\git2-106a5f2.dll'
  at (wrapper managed-to-native) System.Reflection.Assembly.LoadFrom(string,bool)
  at System.Reflection.Assembly.LoadFrom (System.String assemblyFile) [0x00000] in <9577ac7a62ef43179789031239ba8798>:0 
  at NeosModLoader.AssemblyLoader.LoadAssembly (System.String filepath) [0x00039] in <12833d5d0793412ca8252021544de084>:0 

I'm pretty sure this is because the way we load nml_libs doesn't work for unmanaged, aka native DLLs. Loading the unmanaged DLLs from the Neos install directory appears to work fine.

zkxs avatar Mar 11 '23 18:03 zkxs