Thursday, 16 May 2019

arcobjects - Debugging ArcMap Add-In .Net 4.5 in Visual Studio 2013: Unable to start ArcMap.exe


I am developping an ArcMap 10.3 Add-In targeting .NET framework 4.5 on Visual Studio 2013. I used ESRI's wizard to build a simple button add-in and the projects debug properties are configured to start the external program "C:\Program Files (x86)\ArcGIS\Desktop10.3\bin\ArcMap.exe".


The add-in ran properly when I started debuggig the Add-In for the first time but I couldn't get the breakpoints to hit. I followed ESRI recommandation "How to debug" on ESRI online help and modified the ArcMap.exe.config file to enable supported runtime 4.0.30319








The next time I started debuggin the Add-In I get an error message from Visual Studio : "Error while trying to run project: Unable to start program 'C:\Program Files (x86)\Desktop10.3\bin\ArcMap.exe'."


Visual Studio 2013 error


This error message comes right after ArcMap's splash screen. The following screenshot is not from the actual Add-in because the splash screen appears and disappears way too fast and I can't get screenshot.


ArcMap 10.3 splash screen


I tried different things but without success :



  • build the project using different platforms :"Any CPU" and "x86"

  • changed "ArcCatalog.exe.config" file to use the same supported runtime

  • restarted computer


  • used different supported runtime version: version="v4.0.30319", version="v4.0", version="v4.5"


I dont know what to do next to be able to debug the Add-in. I don't want to develop without this feature!



Answer



In Visual Studio 2013, to fix this check Use Managed Compatibility mode in VS2013 > Options > Debugging > General (last option in the list).


Original answer by Preston McCormick here


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...