Managed Debugging Assistant 'PInvokeStackImbalance' has detected a problem in...

Last Published: April 26, 2020

Error Message

When debugging in Visual Studio 2013 or Visual Studio 2015 with ArcGIS Engine applications and ArcGIS for Desktop add-ins that reference ESRI.ARCGIS.ADF.Local.dll, The following error can occur:

"Managed Debugging Assistant 'PInvokeStackImbalance' has detected a problem in
 '<Path to add-in or application dll/exe>'."

Error messages may be encountered such as the following:



The reference to ESRI.ARCGIS.ADF.Local.dll in ArcGIS Engine applications or ArcGIS Desktop add-ins can throw the PInvokeStackImbalance message.

Solution or Workaround

To resolve this issue, uncheck the 'Break when this exception type is thrown' checkbox in the error message dialog and continue debugging.

    Article ID:000012655

    • ArcGIS Engine
    • ArcMap
    • ArcObjects SDK Microsoft NET Framework

    Receive notifications and find solutions for new or common issues

    Get summarized answers and video solutions from our new AI chatbot.

    Download the Esri Support App

    Discover more on this topic

    Get help from ArcGIS experts

    Contact technical support

    Download the Esri Support App

    Go to download options