jkortech
jkortech
CC#
Created by peppy on 6/5/2023 in #help
✅ ✅ Vararg P/Invoke (x86) throws BadImageFormatException (0x80131124 "Index not found")
67 replies
CC#
Created by peppy on 6/5/2023 in #help
✅ ✅ Vararg P/Invoke (x86) throws BadImageFormatException (0x80131124 "Index not found")
Can't guarantee we'll fix it for .NET 8 though
67 replies
CC#
Created by peppy on 6/5/2023 in #help
✅ ✅ Vararg P/Invoke (x86) throws BadImageFormatException (0x80131124 "Index not found")
Okay, I'll file a bug
67 replies
CC#
Created by peppy on 6/5/2023 in #help
✅ ✅ Vararg P/Invoke (x86) throws BadImageFormatException (0x80131124 "Index not found")
The caller and callee just need to be in the same assembly
67 replies
CC#
Created by peppy on 6/5/2023 in #help
✅ ✅ Vararg P/Invoke (x86) throws BadImageFormatException (0x80131124 "Index not found")
That also would work
67 replies
CC#
Created by peppy on 6/5/2023 in #help
✅ ✅ Vararg P/Invoke (x86) throws BadImageFormatException (0x80131124 "Index not found")
Can you try changing your code temporarily to make the call happen in fhcorelib.dll instead of in fhcshook.dll, just for this one test?
67 replies
CC#
Created by peppy on 6/5/2023 in #help
✅ ✅ Vararg P/Invoke (x86) throws BadImageFormatException (0x80131124 "Index not found")
Is the call to the vararg P/Invoke in the same assembly as the P/Invoke, or is the call to it in fhcshook.dll?
67 replies
CC#
Created by peppy on 6/5/2023 in #help
✅ ✅ Vararg P/Invoke (x86) throws BadImageFormatException (0x80131124 "Index not found")
I think I found the issue (and it might actually be a bug in the runtime)
67 replies
CC#
Created by peppy on 6/5/2023 in #help
✅ ✅ Vararg P/Invoke (x86) throws BadImageFormatException (0x80131124 "Index not found")
So, the call that's actually throwing the exception is on line 4283. It looks like your metadata image is corrupted. Do you run any post-processing tools on your assembly? I'll see if I can figure out more.
67 replies
CC#
Created by peppy on 6/5/2023 in #help
✅ ✅ Vararg P/Invoke (x86) throws BadImageFormatException (0x80131124 "Index not found")
I've made some progress with this
67 replies
CC#
Created by peppy on 6/5/2023 in #help
✅ ✅ Vararg P/Invoke (x86) throws BadImageFormatException (0x80131124 "Index not found")
A dump with the debugger at this point would be helpful.
67 replies
CC#
Created by peppy on 6/5/2023 in #help
✅ ✅ Vararg P/Invoke (x86) throws BadImageFormatException (0x80131124 "Index not found")
Is this a release build/shipped .NET or is this a debug build?
67 replies
CC#
Created by peppy on 6/5/2023 in #help
✅ ✅ Vararg P/Invoke (x86) throws BadImageFormatException (0x80131124 "Index not found")
That's the information I was looking for, but the stack trace is definitely weird
67 replies
CC#
Created by peppy on 6/5/2023 in #help
✅ ✅ Vararg P/Invoke (x86) throws BadImageFormatException (0x80131124 "Index not found")
In WinDBG, there's a settings page for exceptions, or you can run sxe eh in the command window
67 replies
CC#
Created by peppy on 6/5/2023 in #help
✅ ✅ Vararg P/Invoke (x86) throws BadImageFormatException (0x80131124 "Index not found")
In the ExceptionSettings window, there's a section called C++ Exceptions. Check that box while debugging
67 replies
CC#
Created by peppy on 6/5/2023 in #help
✅ ✅ Vararg P/Invoke (x86) throws BadImageFormatException (0x80131124 "Index not found")
Any chance you can enable first-chance exception handling for C++ exceptions? This is catching the re-throw of the exception as a managed exception.
67 replies