.net 6升级后出现异常
以下代码(在 .net core 3.1 中运行良好)
var jobType = AppDomain.CurrentDomain
.GetAssemblies()
.SelectMany(x => x.DefinedTypes)
.Single(x => x.FullName == className);
className
是我们需要动态实例化的类的命名空间 my.redacted.namespace.Jobs.ReminderMail.MonthlyUpdateReminderJob
这种动态获取 Type
的方式不再可能了吗?该怎么办?
提前致谢
The following code (which worked fine in .net core 3.1)
var jobType = AppDomain.CurrentDomain
.GetAssemblies()
.SelectMany(x => x.DefinedTypes)
.Single(x => x.FullName == className);
is throwing the exception after the upgrade to .net 6
className
is the namespace to a class we need to dynamically instantiate
my.redacted.namespace.Jobs.ReminderMail.MonthlyUpdateReminderJob
Is this way of dynamically getting the Type
not possible anymore and what would be the way to go?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论