Select to view content in your preferred language

Adjusting 3.0 project to 3.1 SDK version

900
3
04-11-2023 03:55 AM
TomGeo
by
Occasional Contributor III

My old addin (coming from 2.9 and migrated into 3.0) needs some brushing up and I am getting some XDG errors from XAML file.

TomGeo_0-1681208085494.png

All the assemblies are where I would expect them to be: C:\Program Files\ArcGIS\Pro\bin or at C:\Program Files\ArcGIS\Pro\bin\Extensions\DesktopExtensions

TomGeo_1-1681208385576.png

I tried SDK utilities to fix Pro references, but it didn't help. I cleaned the solution, deleted the bin and obj directories of the solution.

Here the error codes from above with the lines the error is encountered at

XDG0023d:DataContext="{d:DesignInstance Type=ui:PublicDataDockpaneViewModel}"
XDG0003<ResourceDictionary.MergedDictionaries>
<extensions:DesignOnlyResourceDictionary Source="pack://application:,,,/ArcGIS.Desktop.Framework;component\Themes\Default.xaml" />
</ResourceDictionary.MergedDictionaries>
XDG0010<ResourceDictionary.MergedDictionaries>
<extensions:DesignOnlyResourceDictionary Source="pack://application:,,,/ArcGIS.Desktop.Framework;component\Themes\Default.xaml" />
</ResourceDictionary.MergedDictionaries>
XDG0005<StackPanel Orientation="Horizontal">
<Image Source="pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/GenericRun16.png" />
</StackPanel>
XDG0005<StackPanel Orientation="Horizontal">
<Image Source="pack://application:,,,/ArcGIS.Desktop.Resources;component/images/genericreset16.png" />
</StackPanel>

Since the second error is pointing at an issue with the Default.xaml file I would assume the two XDG0005 are following errors resulting from the XDG0010.

- We are living in the 21st century.
GIS moved on and nobody needs a format consisting out of at least three files! No, nobody needs shapefiles, not even for the sake of an exchange format. Folks, use GeoPackage to exchange data with other GIS!
0 Kudos
3 Replies
RichardDaniels
Regular Contributor
Just a comment regarding Visual Studio 2022. The new version of VS treats many 'warning' messages as errors that stop a build. In VS these same issues were treated as warnings or informational only so you still could get a clean build. Check the error messages and see if you can change your build settings to ignore XDG0005 -them if they appear in consequential.
0 Kudos
TomGeo
by
Occasional Contributor III

The weird thing is, these errors do not stop the build. The addin is build and deployed.
When ArcGIS Pro starts, the menu and its ribbon are created. The ribbon contains the groups and buttons it should have...
Calling the dockpane from on of the buttons in the ribbon though, only leads to a busy system and the dockpane is never shown.
At the same time I cannot see anything in the debug session that there is an error, or what is keeping the system from showing the dockpane.

- We are living in the 21st century.
GIS moved on and nobody needs a format consisting out of at least three files! No, nobody needs shapefiles, not even for the sake of an exchange format. Folks, use GeoPackage to exchange data with other GIS!
0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

The errors you are seeing are coming from the XAML Designer in Visual Studio.  Unfortunately, Microsoft introduced a bug into the Designer where the Designer fails to locate required assemblies (this issue was introduced when we switched from x86/x64 mixed builds to x64 builds).  When you close the XAML Designer these errors are cleared.  These errors do not have any effect on the actual build.  Also Visual Studio and MSBuild seem to have no problem finding those assemblies.   I reported this issue to Microsoft but they claimed to have this issue fixed.  

Regarding your second question:

Calling the dockpane from one of the buttons in the ribbon though, only leads to a busy system and the dockpane is never shown.

You need to step through your code to see what's going on.  Usually when you click on a show dockpane button the Onclick method is called in the ViewModel file created by the dockpane item template.  Try to set a breakpoint there, if that works, set breakpoints in you dockpane constructor etc. 
In general, these types of errors occur after partially renaming ids or classes, or sometimes multiple open instances of ArcGIS Pro prevent the add-in from being installed properly.  If you create a new add-in and then add item templates (like dockpanes etc.) to the project without modifying any files the add-in should work properly and open the dockpane, so i would look at the modification you made to the project after you used the item templates.

If you find a specific code snippet that is causing the hang you can share it here and we can help you out.

0 Kudos