Select to view content in your preferred language

"Edit and Continue" in ArcMap with Visual Studio 2012 not working

911
5
02-12-2014 07:27 AM
RiverTaig1
Deactivated User
I have an extension that I would like to debug using "Edit and Continue" so that I don't have to get out of ArcMap to add a little code or to make changes.  Unfortunately, my breakpoints aren't getting hit.  If I hover over the breakpoints I get, "The breakpoint will not be hit. No symbols have been loaded for this document".   The code though is obviously running as it hits messageboxes that I have just added.

==Notes==
1) I am compiling in Debug mode.
2) I'm using .net framework 4.5,
3) I'm using Visual studio 2012.
4) Under Tool>Options>Debugging>Edit and Continue, I have the "Enable Edit and Continue" checkbox checked.
5) I have tried compiling using "Any CPU" and "x86".  
6) On Project>Properties>Debugging, I have set the startup program to ArcMap, and click start (F5) to start ArcMap.

Is there something else I need to do to load the symbols?
0 Kudos
5 Replies
AlexanderGray
Honored Contributor
I have never user VS2012 but I certainly have encountered this.  Make sure you have don't have some other version of the code kicking around.  In debug, you should be able to open the "modules" window.  This shows all the dlls loaded by ArcMap, including your own and the path to the dll.  Make sure you have the right one.
0 Kudos
RiverTaig1
Deactivated User
Thanks - I didn't know about the Modules Window.  In looking at it, I do see a ton of .dlls, but not the one that I am hoping to debug.  But I'm confident that it is running my latest code because I can see a message box pop up that matches a string that I just entered. But for whatever reason, the code won't break on breakpoints.
0 Kudos
AlexanderGray
Honored Contributor
In the debugging options, you can try removing the "Require source files to exactly match the original version"  I have found that in some cases vs recognizes the code as different even when it is not.
0 Kudos
RiverTaig1
Deactivated User
I think the bottom line is that you can't use edit and continue with ArcMap if you are targeting the .NET Framework 4.5.  While Edit and Continue won't work, you can at least still debug (in a read only manner) by attaching to the process: On the Debug menu, choose Attach to Process, select ArcMap.exe from the list of "Available Processes" and be sure to Select "Managed (v4.5, v4.0) code" or those breakpoints won't be hit either.
0 Kudos
RiverTaig1
Deactivated User
It turns out that you can use edit and continue if you are targeting the .NET framework 4.5. Here's how:

http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//000100000nzv000000

On the off chance that link breaks in the future, in a nutshell what you need to do is open up ArcMap.exe.config (in the same folder as ArcMap) and edit the file by adding the line of code in bold below:

  <startup>
    <!--<supportedRuntime version="v4.0.30319"/>-->
     <supportedRuntime version="v4.0.30319"/>
    <supportedRuntime version="v2.0.50727"/>
  </startup>
0 Kudos