Unloading assembly with Avalonia controls #17100
Replies: 3 comments
-
Not familiar with this area, but check this sample if you haven't: You should also remove any added styles and resources. The sample doesn't seem to remove resources though, but maybe it's just not obvious. The plugin doesn't have any resources because it opted to use a |
Beta Was this translation helpful? Give feedback.
-
@MaxwellDAssistek I have been hacking together an integrated Module builder for my demo Avalonia Prism application and I have a similar problem in that the Prism Module loader does not actually support unloading of modules... My integrated module builder is such an awesome exciting feature that is really just a big memory leak right now lol. I am not yet ready to face down that mountain of a task that is trying to figure out how to make an Unloadable Prism Module loader but thank you for asking this question because it will no doubt help me in the future! |
Beta Was this translation helpful? Give feedback.
-
I am kind of stumped at this point. I was able to eventually eliminate enough things like DialogHost and now the backing class behind the view in the module is getting cleaned up, but the Xaml object is still getting left behind. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm working on an application where we are loading and unloading plugins with Avalonia controls in them. Each plugin is loaded into its own AssemblyLoadContext. The problem seems that those modules seem to remain loaded because the types used in them are still registered in Avalonia in some way.
One of the places that I found is AvaloniaPropertyRegistry. I did try the new UnregisterByModule method, but if I inspect the internal _properties dictionary using a debugger after calling that method I can still see various properties remain registered.
This is what I have set up in my AssemblyLoadContext currently:
Beta Was this translation helpful? Give feedback.
All reactions