yiyungent / PluginCore

🔌 ASP.NET Core lightweight plugin framework | ASP.NET Core 轻量级 插件框架 - 一分钟集成 | Vue.js frontend | JavaScript SDK
https://yiyungent.github.io/PluginCore/
GNU Lesser General Public License v3.0
457 stars 87 forks source link

插件Middleware异常 #38

Open czhrf opened 2 weeks ago

czhrf commented 2 weeks ago

启用插件异常 PluginCore.AspNetCore.Middlewares.PluginStartupXMiddleware[0] PluginCore: Unable to resolve service for type 'PluginCore.Interfaces.IPluginFinder' while attempting to Invoke middleware 'HelloWorldPlugin.Middlewares.SayHelloMiddleware'. System.InvalidOperationException: Unable to resolve service for type 'PluginCore.Interfaces.IPluginFinder' while attempting to Invoke middleware 'HelloWorldPlugin.Middlewares.SayHelloMiddleware'. at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.GetService(IServiceProvider sp, Type type, Type middleware) at lambda_method27(Closure , Object , HttpContext , IServiceProvider ) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass5_1.b__2(HttpContext context) at PluginCore.AspNetCore.Middlewares.PluginStartupXMiddleware.InvokeAsync(HttpContext httpContext, IPluginApplicationBuilderManager pluginApplicationBuilderManager) in F:\PluginCore\src\PluginCore.AspNetCore\Middlewares\PluginStartupXMiddleware.cs:line 44

yiyungent commented 2 weeks ago

请提供下插件版本,以及 PluginCore 相关包版本,有无对 PluginCore 做自定义替换内部

czhrf commented 1 week ago

使用的plugin目录中的插件HelloWorldPlugin,控制器做了修改 方法头增加了[HttpGet],其他代码没有变更

yiyungent commented 1 week ago

使用的plugin目录中的插件HelloWorldPlugin,控制器做了修改 方法头增加了[HttpGet],其他代码没有变更

尝试更新 Hellowworldplugin 里引用的plugincore到最新, 以及你确定是启用插件时报错,而不是访问某个插件api路径

建议参考 KnifeHub 里的插件,这个仓库里的插件太久没更新了