Select to view content in your preferred language

Is there any way to reload Pro Add-in without exiting ArcGIS Pro?

901
6
Jump to solution
07-15-2024 07:31 AM
tamasoz
Occasional Contributor

Hi All,

 

I wonder how to reload add-ins in ArcGIS Pro without exiting and restarting the application.

The reason of me asking this is because I need to develop a few add-ins and I realized when I rebuild the solution in Visual Studio it actually executes the RegisterAddIn.exe executable - but there are no changes occurring in the add-in unless I restart Pro.

I was looking into the documentations, but I couldn't find any answers yet. Regarding the UI update during development, I am aware that there is something called XAML Hot reload in WPF/UWP that I successfully used before in a non-ArcGIS Pro-based development when I changed some XAML elements - in such case there were no need to restart the running debugging session, changes just showed up upon saving the new XAML. This is mainly for XAML changes only though, as far as I recall code changes not always propagate this way.

Still - I was not able to configure that in VS 2022 and the XAML hot reload stays disabled - I checked all settings as per Microsoft recommendation but no luck.

Dealing with Light and Dark Themes in WPF Windows - @Wolf in this article points out that the XAML reload can actually work.

At this stage I am trying to build up a development routine pathway, which somehow reduces the number of load-in/load-out of ArcGIS Pro during debugging.

Any help, pointers to doco's, etc will be very much appreciated.

Tamas

 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

Manage add-ins—ArcGIS Pro | Documentation

step 4  If ArcGIS Pro is open, exit and restart the application.

check other sections there as well


... sort of retired...

View solution in original post

0 Kudos
6 Replies
DanPatterson
MVP Esteemed Contributor

Manage add-ins—ArcGIS Pro | Documentation

step 4  If ArcGIS Pro is open, exit and restart the application.

check other sections there as well


... sort of retired...
0 Kudos
tamasoz
Occasional Contributor

Thank you - so it seems there is always a need for an exit-restart if I want to see changes made in a deployed add-in.

Cheers

 

0 Kudos
RichardDaniels
Honored Contributor

Since you are talking about Development in Visual Studio, it sounds like you need to setup your debug environment to launch and run ArcGIS Pro. Using the debug environment gives you the ability to do 'hot reload' of code so you can edit 'most' forms and modules without restarting ArcGIS Pro, secondly recall that you need to update the config.daml <Date>02/04/2025 10:45:00 AM</Date> tag every time you rebuild and deploy your add-in.

In Visual Studio you need to setup you test environment. In your .\properties folder in your project you should have a launchSettings.json file with the following:

 

{
"profiles": {
"NameOfYourAddIn": {
"commandName": "Executable",
"executablePath": "C:\\Program Files\\ArcGIS\\Pro\\bin\\ArcGISPro.exe",
"commandLineArgs": ""
}
}
}  

 

This can be SET in Visual Studio with Project Properties -> Debug -> Open Debug Launch Profiles -> New Profile -> Executable.

RichardDaniels_1-1738778910592.png

 

 

0 Kudos
RichardDaniels
Honored Contributor

Also, if you setup your test environment as described above, but it looks like 'the old code' keeps running, remember to CLEAR your Cache at C:\Users\<UserName>\AppData\Local\ESRI\ArcGISPro\AssemblyCache

0 Kudos
tamasoz
Occasional Contributor

Thanks @RichardDaniels , VS configured itself ok upon installing the Pro development VSIX file including the Debug run configuration. Thankfully I have not had any issues with "old code" running - but I will remember the location of the AssemblyCache just in case.

In the meantime, I have been able to set up the hot deploy feature in VS (It was just not fully activated within VS), so now I can see code change results in a running Pro/add-in debug session without the need of a full start/stop cycle - like in an ordinary WPF environment.

0 Kudos
TamasGIS
Emerging Contributor

Replying just to keep my ex-corporate account's forum post to link to my private forum account.

0 Kudos