Windows 11 - Managed Debugging Assistant 'PInvokeStackImbalance' error

Add-in Express™ Support Service
That's what is more important than anything else

Windows 11 - Managed Debugging Assistant 'PInvokeStackImbalance' error
 
Ionut Adrian


Guest


Hi there,

I'm getting this error when starting to debug an Excel add-in project in VS2022 on Windows 11:

Managed Debugging Assistant 'PInvokeStackImbalance'
Message=Managed Debugging Assistant 'PInvokeStackImbalance' : 'A call to PInvoke function 'AddinExpress.MSO.2005!AddinExpress.MSO.GetTempMemoryDelegate::Invoke' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.'


User added an image

The corresponding setup project installs the add-in and it works fine in latest Excel on Windows 11. But I cannot debug the project due to the above error.

Everything works fine in VS2022 on Windows 10.

Any ideas?

Adrian
Posted 14 Apr, 2022 15:26:34 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Ionut Adrian,

Thank you for the feedback. I will investigate the issue.
Please try to disable this exception in the 'Exception Settings' window of Visual Studio. Let me know if the issue still exists.
Posted 15 Apr, 2022 06:33:18 Top
Ionut Adrian


Guest


Hi Sergey,

Disabling that exception in 'Exception Settings' did the trick.

Thank you,
Adrian
Posted 15 Apr, 2022 06:59:12 Top