i am developing plugin from this reference link https://github.com/natemcmaster/DotNetCorePlugins
below code work fine earlier but suddenly it stop working here is my starup.cs code
foreach (var pluginDir in Directory.GetDirectories("D:\\Software\\TM.Plugin\\TestPlugin\\Build"))
{
var dirName = Path.GetFileName(pluginDir);
var pluginFile = Path.Combine(pluginDir, dirName + ".dll");
var loader = PluginLoader.CreateFromAssemblyFile(pluginFile,
// this ensures that the plugin resolves to the same version of DependencyInjection
// and ASP.NET Core that the current app uses
sharedTypes: new[]
{
typeof(IApplicationBuilder),
typeof(IWebPlugin),
typeof(IServiceCollection),
});//upto here code working fine
foreach (var type in loader.LoadDefaultAssembly()
.GetTypes()
.Where(t => typeof(IWebPlugin).IsAssignableFrom(t) && !t.IsAbstract))//here it will throw error
{
var plugin = (IWebPlugin)Activator.CreateInstance(type);
_plugins.Add(plugin);
}
}