Debugging ArcMap Add-In .Net 4.5 : Unable to start ArcMap.exe

18605
14
Jump to solution
06-10-2015 05:15 AM
RaymondTiefengraber1
New Contributor II

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

<startup>

     <supportedRuntime version="v4.0.30319"/>

      <!-- <supportedRuntime version="v2.0.50727"/> -->

</startup>

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'."

VS2013 - Unable to start arcmap.png

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.

ArcGis splash screen.png

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!

Any help would be greatly appreciated.

Thanks

14 Replies
AlexanderGray
Occasional Contributor III

Awesome, just what I was looking for.  So far it works great

0 Kudos
NickStrickling
New Contributor II

This also worked for me.  Thank You!!

Any insight to why this works?

EIther way, thanks again. 

0 Kudos
RaymondTiefengraber1
New Contributor II

Thank you! I was able to run and debug the Addin.

0 Kudos
DavidWilton
Occasional Contributor

Yeah great! It works but we lose edit and continue?! This wouldn't be so bad if ArcMap didn't take an age to start. This makes debugging very tiresome

Screen Shot 2016-03-24 at 12.53.47 PM.png

ChrisSaylor
New Contributor II

This may be a fluke, but I seem to have stumbled upon a solution.  Open VS, turn on Managed Compatibility Mode and start ArcMap once.  Hit the stop button to close ArcMap, then turn off Managed Compatibility Mode, then press play.  ArcMap magically started the second time, and I was able to use edit-and-continue.  I tried this in both VS 2013 and VS 2015, and it worked, though in VS 2013 I had to press play 3 times in a row before ArcMap started.  Like I said, I'm not sure if this is a solution per se, but it works at least for me.