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

9620
15
Jump to solution
10-25-2011 12:50 PM
JakubSisak
Occasional Contributor III
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.
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable
Try removing
    <supportedRuntime version="v2.0.50727"/>
from arcmap.exe.config, in the bin directory.

View solution in original post

0 Kudos
15 Replies
by Anonymous User
Not applicable
Try removing
    <supportedRuntime version="v2.0.50727"/>
from arcmap.exe.config, in the bin directory.
0 Kudos
MarielaDel_Rio
New Contributor III

This worked for me, thank you! I uncommented the v4.0 and commented the v2.0

Before:

  <startup>

    <!-- <supportedRuntime version="v4.0.30319"/> -->

<supportedRuntime version="v2.0.50727"/>

  </startup>

After:

  <startup>

    <supportedRuntime version="v4.0.30319"/>

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

  </startup>

0 Kudos
JakubSisak
Occasional Contributor III
Thanks Sean. That's certainly something I have not yet tried.  From which directory should I remove this item. I does not seem to be in the project directory. (This issue is project specific.)
0 Kudos
by Anonymous User
Not applicable
Its the ArcMap application config file
\ArcGIS\Desktop10.0\bin\arcmap.exe.config

Its an xml file so modify it with notepad. This isn't an official solution by the way....
0 Kudos
RonAnkeny
New Contributor III
I'm recieving the The breakpoint will not currently be hit.  The source code is different then the original version message on all breakpoints after following the Migrating ArcGIS 9.3 Desktop and Engine custom components to ArcGIS 10 steps. This occurs on all migrated code as well as a simple 'Hello World' button I created in 10 as a test. Disabling the "Require the source version to exactly match the origional version" option in VS Tools>Options>Debugging fixes this issue, but that doesnt sit right with me.

Is anyone else having this issue with their (NON ADD-IN) projects, and what was done to correct this issue?
0 Kudos
StephenKilburn
New Contributor III
I encountered the same frustrating problem and eventually found a solution. Cutting to the chase, I'll give the solution first, then the explanation:

Open Task Manager. End Process for any copy of ArcMap.exe.

Open a Windows Explorer. Navigate to C:\Users\\Local Settings\ESRI\Desktop10..

If you don't see AssemblyCache, Organize > Folder and search options > View > uncheck "Hide protected operating system files (recommended)"

In the directories in AssemblyCache, look for the one containing your .dll.

Delete the .dll.

Rebuild the project and debug. Once your add in activates you should see the cache contents get refreshed.

If desired, re-hide the protected OS files.

The problem for me was that there was an old instance of my DLL in the C:\Users\\Local Settings\ESRI\DesktopX.X\AssemblyCache\ folder, and I also couldn't see \AssemblyCache because I didn't realize it was a hidden OS file. There was also a zombie instance of ArcMap running, and when I tried to delete the DLL initially it was locked. My suspicion is that what caused the problem in the first place is that I didn't quite fully shut down a debugging session of ArcMap before recompiling the code and starting another. The old DLL in the cache couldn't get overwritten because the old ArcMap instance still had it locked, and once it got out of synch with the new code the cached version no longer got updated. (I can see by file dates that the .config, .pdb, and .xml are being updated but not the .dll.)
0 Kudos
JakubSisak
Occasional Contributor III
This solution doesn't work.
0 Kudos
MarielaDel_Rio
New Contributor III

It worked for me. This was the change, I commented V2 and uncommented V4

  <startup>

    <supportedRuntime version="v4.0.30319"/>

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

  </startup>

0 Kudos
JakubSisak
Occasional Contributor III
Its the ArcMap application config file
\ArcGIS\Desktop10.0\bin\arcmap.exe.config

Its an xml file so modify it with notepad. This isn't an official solution by the way....



This solution doesn't work
0 Kudos