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

8407
15
Jump to solution
10-25-2011 12:50 PM
Highlighted
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
1 Solution

Accepted Solutions
Highlighted
Esri Regular Contributor
Try removing
    <supportedRuntime version="v2.0.50727"/>
from arcmap.exe.config, in the bin directory.

View solution in original post

Reply
0 Kudos
15 Replies
Highlighted
Esri Regular Contributor
Try removing
    <supportedRuntime version="v2.0.50727"/>
from arcmap.exe.config, in the bin directory.

View solution in original post

Reply
0 Kudos
Highlighted
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>

Reply
0 Kudos
Highlighted
Regular Contributor
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.)
Reply
0 Kudos
Highlighted
Esri Regular Contributor
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....
Reply
0 Kudos
Highlighted
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?
Reply
0 Kudos
Highlighted
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.)
Reply
0 Kudos
Highlighted
Regular Contributor
This solution doesn't work.
Reply
0 Kudos
Highlighted
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>

Reply
0 Kudos
Highlighted
Regular Contributor
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
Reply
0 Kudos