More Events for Reloading
See original GitHub issueHello, I’m trying to build a Plugin System on top of your awesome Library. I currently have the following use cases:
- Download & Start Plugins at runtime
- Upgrade Plugins at runtime
- Stop Plugins at runtime
while downloading, starting and stopping is actually working really nicely, reloading/upgrading has some caveheats.
currently I have uploaded a demo project at github here: https://github.com/schmitch/dotnet-plugin-demo
currently I need to have a Stop method called before reloading my plugin. Unfortunatly I can only call it after the plugin got reloaded.
That is my log output:
Current Time V4: 23.10.2019 12:04:50
Reload Triggered, EventArgs: McMaster.NETCore.Plugins.PluginLoader / McMaster.NETCore.Plugins.PluginLoader
info: Microsoft.Hosting.Lifetime[0]
Application is shutting down...
Created plugin instance 'Timestamp Plugin V5'.
Current Time V5: 23.10.2019 12:04:52
How it should be:
Current Time V4: 23.10.2019 12:04:50
info: Microsoft.Hosting.Lifetime[0]
Application is shutting down...
Reload Triggered, EventArgs: McMaster.NETCore.Plugins.PluginLoader / McMaster.NETCore.Plugins.PluginLoader
Created plugin instance 'Timestamp Plugin V5'.
Current Time V5: 23.10.2019 12:04:52
Currently I think it would be possible by introducing an event that will be called, before this._context.Unload();
is called. Maybe call it BeforeReload
(i.e. Reloaded
could also be deprecated in favor of AfterReload
, then)?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:11 (5 by maintainers)
Top Results From Across the Web
So apparently reloading a game gives me a bunch of ...
So apparently reloading a game gives me a bunch of random events, changes my relegion, takes decisions for me and changes my ruler?...
Read more >Event outcome is predetermined? - Paradox Interactive Forums
Ruler dies... reload multiple times (around 20), same result with only 30% chance, even let the game run a few days and tick...
Read more >[#10] Weapon Reloading using animation events in unity
This video demonstrates how to add reloading to your character using animation events. There are 4 animations events, detach, drop, refill, ...
Read more >Page reload in Chrome unnecessarily triggers bound ...
When I refresh page two more are quickly output, and instantly after that two more (from new page view). If I instead just...
Read more >Events reset to original spot when reloading a game
So I have been getting this issue with my events. ... Use multiple events and use switches (and/or variables) to determine which one...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In terms of cleanup how about this:
A) Make sure you call Dispose() on any disposable instances loaded from that assy load context. This is easier if for example you have a DI container responsible for the lifetime of all those types, and then you can just Dispose() that container.
u are right,i do own file watcher and call the Reload now. thanks for share your idea.