An overlapped pointer ( 1$p) that was not allocated on the GC heap was passed via PInvoke to the Win32 function '%2$s' in ...

An overlapped pointer (0x%1$p) that was not allocated on the GC heap was passed via PInvoke to the Win32 function '%2$s' in module '%3$s'. If the AppDomain is shut down, this can cause heap corruption when the async I/O completes. The best solution is to pass a NativeOverlapped structure retrieved from a call to System.Threading.Overlapped.Pack(). If the AppDomain exits, the CLR will keep this structure alive and pinned until the I/O completes.