8.6K Star 14.2K Fork 4.2K

GVPdotNET China/Furion

 / 详情

泛型的BackgroundService类在自动注册的时候会报异常

已完成
创建于  
2021-04-28 15:28

特别说明:如果 Issue 报告为问题且开发成员回复确认问题之后但三天内都不能得到反馈,则视为无效Issue。

Furion 版本号

V2.1.12

描述你的问题

对于继承自BackgroundService的泛型Worker,在框架扫描后自动注册的时候会报异常

异常堆栈信息

Unhandled exception. System.InvalidOperationException: Late bound operations cannot be performed on types or methods for which ContainsGenericParameters is true.
at System.Reflection.RuntimeMethodInfo.ThrowNoInvokeException()
at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)


代码或代码仓库

什么代码导致?
public class WsWorker<TS, TO> : BackgroundService { ... }

期待结果

建议增加是否自动注册BackgroundService的选项

评论 (0)

SamWangCoder 创建了任务 4年前
SamWangCoder 关联仓库设置为dotNET China/Furion 4年前
SamWangCoder 添加了
 
建议
标签
4年前
SamWangCoder 添加了
 
优先
标签
4年前
SamWangCoder 移除了
 
优先
标签
4年前
SamWangCoder 添加了
 
优化
标签
4年前
SamWangCoder 修改了描述 4年前
SamWangCoder 修改了描述 4年前
百小僧 任务状态待办的 修改为进行中 4年前
百小僧 负责人设置为百小僧 4年前
百小僧 里程碑设置为Furion 2021 4年前
百小僧 关联分支设置为master 4年前
百小僧 计划截止日期设置为2021-04-29 4年前
百小僧 计划开始日期设置为2021-04-28 4年前
百小僧 计划截止日期2021-04-29 修改为2021-04-28 4年前
百小僧 置顶等级设置为 4年前
百小僧 优先级设置为严重 4年前
百小僧 通过 dotnetchina/Furion Commit c9aaee4任务状态进行中 修改为已完成 4年前
百小僧 置顶等级 修改为不置顶 4年前
百小僧 关联分支master 修改为未关联 2年前
展开全部操作日志

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(1)
8339555 samwangcoder 1615271865
C#
1
https://gitee.com/dotnetchina/Furion.git
git@gitee.com:dotnetchina/Furion.git
dotnetchina
Furion
Furion

搜索帮助