Debugging Line by Line in ArcMap VBA Editor vs. Visual Studio 2010 Add In Debugging

11-12-2013 09:38 AM
by Anonymous User
Not applicable
Original User: mb1471

Using ArcMap 10.0, in the vba code editor, I can add a shapefile to the Table of Contents.  I can execute a line of code in the vba editor and actually see a shapefile being added to the Table of Contents.  Then using a vba code editor break point I can move to ArcMap and examine the newly added shapefile. I can also hit ctrl + break during vba code execution, code is halted and I can use any ArcMap command interactively while vba code execution is paused.

I have not figured out how to do this in Visual Studio 2010.  In Visual Studio, I add a shapefile to ArcMap using a line of ArcObjects code.  The line of code executes, Visual Studio stops on a breakpoint, but I cannot then move to ArcMap and observe or examine the newly added shapefile.  ArcMap 10.0 just says �??Not Responding�?� if I attempt to click in the Table of Contents.

In Visual Studio 2010 I have been debugging using the following steps 

1. Open Visual Studio Add In project
2. Set Debugging Properties to �??START EXTERNAL PROGRAM�?� pointing to ArcMap.exe
3. set breakpoints in Visual Studio Code
4. Hit the debug button (f5) from the debug drop down menu  (the start program button)
5.  hitting f5 from Visual Studio opens ArcMap.exe
6. I then add the Add In Button to the newly opened (debugging mode) ArcMap.exe  
7. In ArcMap I click on the Add In to start code execution
8. Once code executes in Visual Studio or the first breakpoint is hit, I can�??t access ArcMap at all, just get �??not responding�?�

Any solutions or feedback ??
Thanks Matt
0 Kudos
1 Reply
Regular Contributor III
ArcMap is not running when you are stopped on a breakpoint in Visual Studio.

VBA is different in that it is integrated into ArcMap.

One suggestion is to use a PC with 2 screens.  Put Visual Studio on one screen and ArcMap on the other.  You still won't be able to interact with ArcMap but you should be able to see the display.
0 Kudos