Select to view content in your preferred language

How to avoid crash when add-in has a visible DockPane and cannot initialize?

62
0
yesterday
mahj
by
Occasional Contributor

If an ArcGIS Pro add-in has a DockPane that is currently visible and the add-in's overridden Module.Initialize() method returns false because it for some reason cannot initialize properly, ArcGIS Pro crashes.

How can that be avoided? I have tried to hide the DockPane in either Module.Initialize() or Module.Uninitialize(), but nothing seems to help.

I'm using ArcGIS Pro 3.5.3.

Steps to reproduce:

1. Start Visual Studio 2022 (17.14.18 in my case)
2. Create new project of type ArcGIS Pro Module Add-in
3. Right-click project in Solution Explorer, select Add->New Item...
4. In the Add New Item dialog select 'ArcGIS Pro Dockpane' and click Add
5. Press Ctrl+F5 to build and run the project
6. When ArcGIS Pro starts create a new Map project
7. Click on the Add-In tab and click the 'Show Dockpane 1' button in 'Group 1'
8. Press Ctrl+S to save the project and close ArcGIS Pro
9. Open Module1.cs in Solution Explorer, override the Initialize() method, and make it return false.
10. Press Ctrl+F5 to build and run the project
11. When ArcGIS Pro starts, open the saved project
12. ArcGIS Pro crashes and displays the "ArcGIS Application has stopped working" dialog

Thanks for any help!

0 Kudos
0 Replies