The thrown exceptions look like these:

ERROR: System.MissingMethodException: Method not found: 'Int32 System.Runtime.InteropServices.Marshal.SizeOf(!!0)'. ERROR: System.MissingMethodException: Method not found: 'Void System.Runtime.InteropServices.Marshal.StructureToPtr(!!0, IntPtr, Boolean)'.

    ---- this are the faulting lines (in the code I'm working with) ----
    Int32 intTokenElevationSize = Marshal.SizeOf(tevTokenElevation);
    Marshal.StructureToPtr(tevTokenElevation, pteTokenElevation, true);

    ---- explicitly casting to object fixes the method not found error ----
Int32 intTokenElevationSize = Marshal.SizeOf((object)tevTokenElevation); Marshal.StructureToPtr((object)tevTokenElevation, pteTokenElevation, true);

Reply via email to