Merge pull request #1004 from Aireil/reload_first

feat: reload manifest before trying to load when hot-reloading
This commit is contained in:
goat 2022-09-13 22:44:05 +02:00 committed by GitHub
commit bba41fe779
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -285,6 +285,16 @@ internal class LocalPlugin : IDisposable
await this.pluginLoadStateLock.WaitAsync(); await this.pluginLoadStateLock.WaitAsync();
try try
{ {
if (reloading && this.IsDev)
{
// Reload the manifest in-case there were changes here too.
var manifestDevFile = LocalPluginManifest.GetManifestFile(this.DllFile);
if (manifestDevFile.Exists)
{
this.Manifest = LocalPluginManifest.Load(manifestDevFile);
}
}
switch (this.State) switch (this.State)
{ {
case PluginState.Loaded: case PluginState.Loaded:
@ -359,16 +369,6 @@ internal class LocalPlugin : IDisposable
} }
this.loader.Reload(); this.loader.Reload();
if (this.IsDev)
{
// Reload the manifest in-case there were changes here too.
var manifestDevFile = LocalPluginManifest.GetManifestFile(this.DllFile);
if (manifestDevFile.Exists)
{
this.Manifest = LocalPluginManifest.Load(manifestDevFile);
}
}
} }
// Load the assembly // Load the assembly