XAML Binding failure when ARCGIS PRO SDK starts

386
6
11-29-2020 08:58 AM
OguzSariyildiz
Occasional Contributor

I created a ProModule with SDK 

I get this error as soon as AGP started via Visual Studio

OguzSariyildiz_0-1606678274017.png

I removed the add-in and created an empty module I still get this binding failure. Do you have any idea what is going on?

0 Kudos
6 Replies
Wolf
by Esri Regular Contributor
Esri Regular Contributor

An empty Pro Add-in module does not contain XAML, so you must still have a bad add-in in your well-known addin folder that is getting loaded every time  when Pro starts.  Check the ArcGIS folder (under Documents) and delete all add-ins you still have in that folder.  Then re-built your empty module (from you post above) and run it again.  There shouldn't be any XAML binding / runtime errors, because the Module add-in doesn't contain any XAML.  The screenshot above indicates that your data context is null, so you have to provide more information on how you got to that point.  When adding items to an empty pro sdk add-in module please use the item templates because they ensure that the datacontext is set properly.

0 Kudos
OguzSariyildiz
Occasional Contributor

Thank you @Wolf , I deleted all add-ins inside C:\Users\user_name\Documents\ArcGIS\AddIns\ArcGISPro but they error still shows up. 

Would you please give me an example of ItemTemplate ? I might be having having problem of not following MVVM model also. I am using Code-behind to update controls. 

 

0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

If you are just getting started with Pro you can follow this Pro Guide here: ProGuide Build your first add in · Esri/arcgis-pro-sdk Wiki (github.com)

It shows you how to first use a 'project template' in visual studio to create a Pro Module Add-in and then an 'Item template' to add a button to the add-in.  When you add a button to your project, the button doesn't have any XAML associated with it, but you can add a 'Dockpane' Control in your sample and now you have the dockpane usercontrol with XAML (the view) and the MVVM viewmodel (code behind) file.  

We have this concept document: arcgis-pro-sdk wiki ProConcepts-Framework  that will give you an overview of the Pro UI and how to integrate your own workflows.

Also we have plenty of samples (including many MVVM samples) in our arcgis-pro-sdk-community-samples  GitHub samples repo.

Finally there's a ArcGIS Pro command line switch that allows you to see the complete (combined) DAML (and hence all add-ins that are loaded), so you can see what's actually included by Pro when it starts running.  You can find information for this here:  https://github.com/Esri/arcgis-pro-sdk/wiki/ProGuide-Command-line-switches-for-ArcGISPro.exe#view-th...  

OguzSariyildiz
Occasional Contributor

Great resources!

0 Kudos
HarishPalaniappan
New Contributor III

This issue can occur when there are broken references. You can try fixing this with ArcGIS Pro SDK for .NET utilities. Pro Fix References utility can help.

Original post doesn’t have SDK version mentioned so below ref. link is taken for 2.6 ver. SDK.

https://github.com/Esri/arcgis-pro-sdk

0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Just to clarify: if you create an new add-in module on your dev machine using the ArcGIS Pro SDK project templates you will not get any broken references, because the Pro SDK is using the install location of ArcGIS Pro for its references.  You will only see broken references if you uninstall ArcGIS Pro and then re-install to a different installation root folder.  

0 Kudos