Why can't the breakpoint be ???hit??? when debugging an ArcGIS 10 Add-In?

8455
15
Jump to solution
10-25-2011 12:50 PM
JakubSisak
Regular Contributor
Now and then I run into the following problem:
  I start debugging the Add-In and breakpoints are ignored. Almost  seems like the communication between the IDE and the component is not  working.
  My problem is that the last time this had happened I resolved it and now I can't remember what I did to fix it.



I also posted the a similar question here, but the solution there does not work.
Reply
0 Kudos
15 Replies
RichardWatson
Regular Contributor III
You have to edit the ArcMap.exe.config file if your add-in is using the 4.0 or later framework.  Out of the box, this file assumes that you are using the 3.5.1 framework.

If you have done that and your breakpoints are not being honored then attach Visual Studio to ArcMap.exe and look at the modules which are loaded and find your DLL.  What you want to do is to find where ArcMap is finding your DLL.  If it is not the one that you expect that that is your problem.
Reply
0 Kudos
MichaelKohler
Occasional Contributor
I've found that if I have been developing an add in, and I use the add in from a copy of arc map that was not opened by clicking the run button from visual studio, the next time I try to debug or hit a breakpoint, it doesn't work.

I just open arc map, go to add in manager, delete the add in from there. Then the next time I run the project from visual studio, it works.
Reply
0 Kudos
BerendVeldkamp
Occasional Contributor II

I ran into the same problem, and none of the solutions worked for me, at least not on their own. I found one more thing that may have been crucial:

After configuring the project to build on the 3.5 framework, I noticed a build warning in Visual Studios output window: warning : The 'language' attribute in the AddIn element is invalid - The value 'CLR4.5'  is invalid according to the project's target framework version - The value should be 'CLR'.

After changing the language attribute in Config.esriaddinx file to CLR, things worked again.

Oh, and one more thing: Initially the breakpoint looks invalid (the breakpoint will not currently be hit). Don't let that fool you, because as soon as the addin is loaded, e.g. by clicking on a button, the breakpoint will be valid.

My other configuration:

  • Supported runtime: v2.0.50727
  • Require source files to exactly match the original version: Checked
  • ArcGIS: 10.3.1
  • Visual Studio: 2013 Update 4
MarielaDel_Rio
New Contributor III

I believe, like you said, the solutions work together. I remember changing the version from V2 to V4 worked, but I also had to ensure the CLR value was the correct one (in my case <AddIn language="CLR4.5" ...) and target CPU x86

Reply
0 Kudos
StuartBricker
New Contributor II

Berend Veldkamp wrote:

...

Oh, and one more thing: Initially the breakpoint looks invalid (the breakpoint will not currently be hit). Don't let that fool you, because as soon as the addin is loaded, e.g. by clicking on a button, the breakpoint will be valid.

...

This is the clincher for me. I changed the runtime version in arcmap.exe.config as per the "unofficial" solution, and I was still getting the invalid breakpoint message. But just as Berend said, as soon as you start your addin, the breakpoint functions as intended. Thank you for saving me pointless additional troubleshooting!

Reply
0 Kudos
CharlesFried
New Contributor III

None of these solutions worked for me this time, although at various times in the past one or the other of these techniques did work.  There seem to be about a 100 ways that this thing can get off the track and it seems to do that spontaneously, at any time (but especially when there is a deadline looming) and I have wasted literally DAYS messing with these and other solutions trying to fix this.  This sucks!

Reply
0 Kudos