WPF application crashes when item from Start Menu is dragged over it

2

I've encountered a strange problem. When an item from the Windows start menu is dragged over the application, it crashes.

However, if I drag a file from Explorer over it, it is handled correctly (the dragged item displays a red circle with a line through it when it is over my application).

And this is where the strange thing happens. Now that I have tried dragging the file from Explorer over it, the program doesn't crash when I try dragging an item from the Start Menu. It only crashes if the first dragged item after startup of the application is from the Start Menu.

The window and all the controls within have AllowDrop="False". I've tried adding event handlers for DragOver and DragEnter on the outer most control, but the breakpoints are never hit.

This is the exception I get:

Managed Debugging Assistant 'FatalExecutionEngineError' : 'The runtime has encountered a fatal error. The address of the error was at 0xc789d078, on thread 0x59f4. The error code is 0x80131623. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.'

Followed by this exception:

System.ExecutionEngineException: 'Exception of type 'System.ExecutionEngineException' was thrown.'

And the application exits.

I'm using Windows 10 and 64bit. .NET Framework 4.7.2

Call stack:

  [External Code] 
DataExchange.dll!CWinRtTarget::DragOver(struct IDragDropArgsPriv *,struct IDragUIOverridePriv * *)  Unknown
rpcrt4.dll!Invoke()    Unknown
rpcrt4.dll!Ndr64StubWorker()    Unknown
rpcrt4.dll!NdrStubCall3()   Unknown
combase.dll!CStdStubBuffer_Invoke(IRpcStubBuffer * This, tagRPCOLEMESSAGE * prpcmsg, IRpcChannelBuffer * pRpcChannelBuffer) Line 1524   C++
rpcrt4.dll!CStdStubBuffer_Invoke()  Unknown
[Inline Frame] combase.dll!InvokeStubWithExceptionPolicyAndTracing::__l6::<lambda_76d9e92c799d246a4afbe64a2bf5673d>::operator()() Line 1907 C++
combase.dll!ObjectMethodExceptionHandlingAction<<lambda_76d9e92c799d246a4afbe64a2bf5673d> >(InvokeStubWithExceptionPolicyAndTracing::__l6::<lambda_76d9e92c799d246a4afbe64a2bf5673d> action, ObjectMethodExceptionHandlingInfo * pExceptionHandlingInfo, ExceptionHandlingResult * pExceptionHandlingResult, void *) Line 91    C++
[Inline Frame] combase.dll!InvokeStubWithExceptionPolicyAndTracing(IRpcStubBuffer * pMsg, tagRPCOLEMESSAGE *) Line 1905 C++
combase.dll!DefaultStubInvoke(bool bIsAsyncBeginMethod, IServerCall * pServerCall, IRpcChannelBuffer * pChannel, IRpcStubBuffer * pStub, unsigned long * pdwFault) Line 1974    C++
[Inline Frame] combase.dll!SyncStubCall::Invoke(IServerCall *) Line 2031    C++
[Inline Frame] combase.dll!SyncServerCall::StubInvoke(IRpcChannelBuffer *) Line 807 C++
[Inline Frame] combase.dll!StubInvoke(tagRPCOLEMESSAGE * pMsg, CStdIdentity * pStdID, IRpcStubBuffer *) Line 2257   C++
combase.dll!ServerCall::ContextInvoke(tagRPCOLEMESSAGE * pMessage, IRpcStubBuffer * pStub, CServerChannel * pChannel, tagIPIDEntry * pIPIDEntry, unsigned long * pdwFault) Line 1542    C++
[Inline Frame] combase.dll!CServerChannel::ContextInvoke(tagRPCOLEMESSAGE *) Line 1438  C++
[Inline Frame] combase.dll!DefaultInvokeInApartment(tagRPCOLEMESSAGE *) Line 3549   C++
[Inline Frame] combase.dll!ClassicSTAInvokeInApartment(ServerCall *) Line 3313  C++
combase.dll!AppInvoke(ServerCall * pServerCall, CServerChannel * pChannel, IRpcStubBuffer * pStub, void * pv, void * pStubBuffer, tagIPIDEntry * pIPIDEntry, WireLocalThis * pLocalb) Line 1688 C++
combase.dll!ComInvokeWithLockAndIPID(ServerCall * pServerCall, tagIPIDEntry * pIPIDEntry, bool * pbCallerResponsibleForRequestMessageCleanup) Line 2804 C++
[Inline Frame] combase.dll!ComInvoke(ServerCall *) Line 2326    C++
combase.dll!ThreadDispatch(ServerCall * pServerCall) Line 422   C++
combase.dll!ThreadWndProc(HWND__ * window, unsigned int message, unsigned __int64 wparam, __int64 params) Line 798  C++
user32.dll!UserCallWinProcCheckWow()    Unknown
user32.dll!DispatchMessageWorker()  Unknown
WindowsBase.ni.dll!00007ffbc7f8f138()   Unknown
.net
wpf
drag-and-drop
crash
executionengineexception
asked on Stack Overflow Apr 3, 2019 by Walkingsteak

1 Answer

0

The same symptoms occur on my computer The same is true for any WPF-created app. Reopen the start menu to fix it.

answered on Stack Overflow Apr 11, 2019 by hide

User contributions licensed under CC BY-SA 3.0