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.
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.
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.
The visibility of this should be so much higher - after hours of Googling and fighting, it was modifying a namespace that caused my addin to stop functioning. It's not something you usually think of, and if you use the wizard and never really look at the config.esriaddinx file, you can miss those subtle things.
Thanks for saving my scalp, Wolf, I was about to pull my hair out!!
I have exactly the same problem. I created a new ArcGIS Pro AddIn using the following instructions:
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!
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.
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.