diff --git a/src/neo/Plugins/Plugin.cs b/src/neo/Plugins/Plugin.cs index 61af339936..93bc4447b2 100644 --- a/src/neo/Plugins/Plugin.cs +++ b/src/neo/Plugins/Plugin.cs @@ -116,7 +116,22 @@ public virtual void Dispose() protected IConfigurationSection GetConfiguration() { - return new ConfigurationBuilder().AddJsonFile(ConfigFile, optional: true).Build().GetSection("PluginConfiguration"); + IConfigurationSection config = null; + int remainingTimes = 3; + while (remainingTimes > 0 && config == null) + { + try + { + config = new ConfigurationBuilder().AddJsonFile(ConfigFile, optional: true).Build().GetSection("PluginConfiguration"); + } + catch (FormatException) + { + remainingTimes--; + Thread.Sleep(10); + } + } + if (config == null) throw new FormatException(); + return config; } private static void LoadPlugin(Assembly assembly)