Grids added with Add-in cause crash when edited in Pro

341
0
03-04-2022 11:23 AM
by Anonymous User
Not applicable

I used method outlined in the code provided here to design part of my add-in that adds a grid to a map layout. It works well and the grid gets added to the Layout no problem. The issue arises if I try to then edit the grid components in the stock ArcGIS Pro 'Format Map Grid' Dockpane after I have added it to the MapFrame. If I do this it crashes pro. While re-creating this crash while debugging, it will show me the following error:

System.AggregateException
HResult=0x80131500
Message=A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread.
Source=mscorlib
StackTrace:
at System.Threading.Tasks.TaskExceptionHolder.Finalize()

Inner Exception 1:
IndexOutOfRangeException: Index was outside the bounds of the array.


I cannot seem to figure out the root cause of this issue as it does not seem to be caused directly during execution of my code. I'm not sure what index it would even be referring to as I am unsure of how the  components dockpane works under the hood. I have tried to load mscorlib with no success to try and see what is going wrong in there. Somehow I must be creating a situation that ends up triggering this if you edit the grid after adding it.   

Does anyone have any experience with this or a similar type of issue? Any advice would greatly appreciated, thanks!

0 Kudos
0 Replies