【问题标题】:Cannot find some "Type" methods / extensions in ASP.NET 5在 ASP.NET 5 中找不到某些“类型”方法/扩展
【发布时间】:2015-03-31 01:18:34
【问题描述】:

哪个包为Type定义了以下方法? :

  • IsGenericType
  • GetGenericArguments
  • 组装
  • 基本类型


/// 更新 /// 阅读@Victor Hurdugaci 的答案后:

所有扩展/方法都应该通过.GetTypeInfo(). 访问,对吗?

【问题讨论】:

  • 我创建了一个小型辅助项目github.com/StefH/ReflectionBridge,它添加了一些扩展方法,用于在 Type 到 TypeInfo 的扩展之间进行桥接。 NuGet 也可用。

标签: asp.net asp.net-core


【解决方案1】:

您可以使用非官方的包搜索来识别类型所在的包http://packagesearch.azurewebsites.net/

  • IsGenericType in System.Reflection(仅适用于 CoreCLR/aspnetcore50)
  • GetGenericArguments in System.Reflection(仅适用于 CoreCLR/aspnetcore50)
  • Assembly in System.Runtime(仅适用于 CoreCLR/aspnetcore50)

【讨论】:

  • 感谢您的链接,但我已经使用了这个。你能检查一下我在问题中更新的文字吗?
猜你喜欢
  • 2013-02-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-01-29
  • 1970-01-01
  • 2022-08-23
  • 2012-07-18
相关资源
最近更新 更多