"The breakpoint will not currently be hit..."

2631
7
08-07-2017 12:35 PM
Highlighted
Occasional Contributor

I'm working on an add-in for ArcGIS Pro, and I am having some trouble hitting breakpoints in my code when debugging via Visual Studio.  I am receiving a warning stating "The breakpoint will not currently be hit. No symbols have been loaded for this document." 

I had previous been able to debug the add-in and hit my breakpoints in the code, but I'm not sure what I did.  After add a few new controls, I seem to be unable to hit any breakpoints in the code.  I've googled around a bit and tried some solutions found in StackOverflow and elsewhere, but I can't seem to resolve this issue.  Has this happened to anyone else before?  Additionally, when I click one of the controls in my add-in, nothing seems to happen, and then the control will turn gray and become disabled.  I haven't seen this behavior before and I'm not sure what I did, as everything was working as expected earlier today.

Reply
0 Kudos
7 Replies
Highlighted
Occasional Contributor

I was not able to find the root cause of this issue. However, I was able to create a new, empty solution, and rebuild my add-in by copying over the code and resources.  Marking question as assumed answered.

Reply
0 Kudos
Highlighted
by Esri Regular Contributor
Esri Regular Contributor

Usually the cause for this type of error is that a class (i.e. your button class) or the add-in DLL were renamed without making the corresponding update in config.daml.  If Pro loads your config.daml and can't find the code behind classes which are referenced in your config.daml, then any UI elements are disabled.

Reply
0 Kudos
Highlighted
Occasional Contributor

I have exactly the same problem. I created a new ArcGIS Pro AddIn using the following instructions:

Build your first add-in | ArcGIS for Developers 

When I'm setting a breakpoint, I am receiving a warning stating "The breakpoint will not currently be hit. No symbols have been loaded for this document." 

Any help would be appreciated!

Reply
0 Kudos
Highlighted
by Esri Regular Contributor
Esri Regular Contributor

The cause could be the same as i mentioned above, mainly the partial renaming.  It's also possible that the cause is installing ArcGIS Pro multiple times under different folders. 

To verify your installation simply create a new 'ArcGIS Pro Module Add-in' name it 'ButtonTest', once the project has been created right click (in solution explorer) on the project, click 'Add | New item', and choose 'ArcGIS Pro Button'.  Now open the Button1 class file and set a breakpoint at the open curly for the OnClick method.  Click on 'Build | Rebuild' then debug your code.  Because Pro will only load your add-in when it's needed, you will see the breakpoint Warning you mentioned, however, once you go to the 'add-in' tab in Pro and click on your 'Button1' icon on the tab, your add-in DLL will be loaded and your breakpoint will be triggered.

Let me know if this works for you.

Highlighted
Occasional Contributor

Hello Wolfgang,

this works, thank you for your reply! So the reason is that Pro will only load my add-in when it's needed, i.e. when the the code runs.

Reply
0 Kudos
Highlighted
by Esri Regular Contributor
Esri Regular Contributor

Hi Barbara,

 you can change the load behavior in the config.daml file by using the 'autoLoad' attribute setting:

 <insertModule id="ProAppModule7_Module" className="Module1" autoLoad="false" caption="Module1">

setting 'autoLoad' to true will load your add-in at startup.  Just note that this might prolong the startup time for ArcGIS Pro.

Highlighted
New Contributor III

Try closing all opened ArcGIS Pro Instances (use Task Manager) before debugging your program.