Select to view content in your preferred language

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

20103
14
Jump to solution
06-10-2015 05:15 AM
RaymondTiefengraber1
Emerging Contributor

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

1 Solution

Accepted Solutions
PrestonMcCormick
Occasional Contributor

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

View solution in original post

14 Replies
RaymondTiefengraber1
Emerging Contributor

The culprit is Visual Studio 2013 but I don't know the exact reason why. I installed Visual Studio 2012 on the same machine and I was able to debug an ArcGIS Desktop 10.3 Add-In with .Net 4.5.

0 Kudos
RaymondTiefengraber1
Emerging Contributor

I finally got to debug the ArcMap 10.3 Add-in with VS2013 in .Net 4.5. I had to attach VS2013 to ArcMap.exe process. This is kinda annoying but it is the only way I got it to work. I'm still confused on why this is happening.

How to attach process

  1. Start ArcMap
  2. In VS2013, go to menu "DEBUG" -> "Attach to Process"
  3. Select "ArcMap.exe" and click on "Attach" button
  4. In ArcMap, make sure the Add-In is installed.

If the Add-in is not installed whe you attach the process, you can try one of these things :

  • Stop debugging and reattach process until Add-Inn is installed
  • Install Add-in manually from your add-in debug folder.
FabienAncelin
Occasional Contributor

In Visual Studio,

Go in your project properties and go to the tab Debug. Make sure that in the section "Start Action", the radio button "Start External Program" is checked and that you put the map to your ArcMap execution file. In my case: "C:\Program Files (x86)\ArcGIS\Desktop10.3\bin\ArcMap.exe"

Hope this helps.

Fabien

PS: the link to the official doc: ArcObjects Help for .NET developers

0 Kudos
RaymondTiefengraber1
Emerging Contributor

Thanks for your time but I already did this as mentioned in my first post.

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

I finally decided to use VS2012 instead of VS2013 for now.

0 Kudos
AlexanderNohe1
Honored Contributor

I had the same issue a little while ago and repairing the .NET Framework helped resolve the issue for me.

AlexanderGray
Honored Contributor

"repairing the .NET Framework helped resolve the issue for me."

Can you expand on what you did exactly or provide a reference.  I am having this problem a lot.  I find that hitting debug repeatedly will sometimes work after two or three times.  If after the 5th time, it didn't, I clean the solution, shutdown VS2013, restart VS2013 rebuild and try again.  Occasionally none of that works and I have to delete the suo file and try again.  At times all that and a reboot it is the only thing that will work...

0 Kudos
AlexanderNohe1
Honored Contributor

Considering that this was awhile ago, it is a little fuzzy for me.  I remember following a guide from Microsoft on how to go about repairing the framework.  This might be of some help:

How to repair an existing installation of the .NET framework

https://support.microsoft.com/en-us/kb/306160

In addition, you may find this useful:

Download Microsoft .NET Framework Repair Tool from Official Microsoft Download Center

0 Kudos
AlexanderGray
Honored Contributor

This has not worked for me...

0 Kudos
PrestonMcCormick
Occasional Contributor

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