How to get Assembly from a Type object in UWP (aka .NET Core)

后端 未结 2 605
无人共我
无人共我 2021-02-18 20:36

The Type class has got an Assembly attribute in .NET Framework. However this attribute is gone when you are writing an UWP which is of course using .NET Core. Only the AssemblyQ

相关标签:
2条回答
  • 2021-02-18 20:51

    You can use typeof(xxx).GetTypeInfo().Assembly to get Assembly。

    0 讨论(0)
  • 2021-02-18 21:01

    Ok I have overlooked the TypeInfo class that is available using GetTypeInfo on a Type object. TypeInfo has got the Assembly property.

    0 讨论(0)
提交回复
热议问题