Plugin definition change doesn't load in XOJO

Hi, I’m using a plugin dll for windows to speed up certain things in my applications. If the plugin have been loaded once into Xojo, Xojo doesn’t detect function interface changes, from changed Dll files during startup. This results in a function item not exist error during debug or compile even though the function is visible from the module object. For Xojo versions older than 2023 this behavior can be worked around by removing the plugin from the plugin folder and restart the Xojo twice. Replacing the plugin files before the second restart will force Xojo to load the new definitions for old xojo versions. Unfortunately, does this work around no longer work for newer versions starting with 2023 of Xojo. The only way I have found for newer xojo releases is to install a clean xojo on a clean OS and copy the plugin into the plugin folder. This proves that it isn’t any error in the pluging.
My question is, if there are anyone knowing what I need to do to make the xojo2024 to reload the dll definitions when the dll is changed. It must be an easy way to change the plugin dll during development of the plugin and test it in the xojo IDE.

I’m using Visual studio 2019 for my plugin development.
Thanks for any information concerning this.

You may add a script to your Visual Studio project to copy the plugin DLL into the Plugins folder.
And then delete the Xojo cache folders.
I do that for my scripts to make sure Xojo rebuilds the plugin cache.

Thank you Christian.
I will try that. I wonder why Xojo doesn’t clear the plugin cache folders when it close down? That will prevent issues like this for many users.
/Håkan

On Windows it is kind of hard to really quit Xojo. Closing all windows doesn’t end the application.

FWIW there’s a setting for this - Options > General > When Closing Last Window. By default it’s set to “Quit” but I only recently discovered this setting could be changed to “Keep Xojo Running” which prevents having to reload Xojo from scratch just because I closed the last project window.

I believe a restart will close Xojo. The reference issue survives an computer restart.

I found this location: C:\Users\myHpZ2\AppData\Local\Temp\XojoIDEPlugins with remaining temp files from yesterday.
image
Can this explain the behavior? I will try an delete this during an experiment.

I suspect one of the reasons is because rebuilding the plugin cache on startup takes extra time, as well when launching the first debug run or analyze after a purge.

It should be possible to configure the behavior then to let the user decide …

Well, it sort of is, indirectly.

Given that many people don’t use Plugins, or don’t have to update their 3rd party Plugins too often - you can purge the cache manually (when you know you need to) by going to Xojo > Settings > Building and clicking “Clear Caches”. Then restart Xojo once the new Plugin(s) is copied into the correct folder.

Hope that helps.

Thank you Scott. I will try this.

1 Like

Thank you both. The Clear Caches saved my day.
Many thanks.

Scott C is correct. The plugin caches persist between launches to save time in loading the IDE. It is particularly important when using large numbers of plugins. If you want to see the effect, try loading one version of the MBS plugin set and record the time. Then quit the IDE and open the IDE again without making any plugin changes. The time reduction is significant.

2 Likes