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'."
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.
I tried different things but without success :
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
Solved! Go to Solution.
In Visual Studio 2013, to fix this check Use Managed Compatibility Mode in Options > Debugging > General (it's last option in the list).
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.
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
If the Add-in is not installed whe you attach the process, you can try one of these things :
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
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.
I had the same issue a little while ago and repairing the .NET Framework helped resolve the issue for me.
"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...
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
This has not worked for me...
In Visual Studio 2013, to fix this check Use Managed Compatibility Mode in Options > Debugging > General (it's last option in the list).