如何从UWP(又名.NET核心)Type对象获得大会 [英] How to get Assembly from a Type object in UWP (aka .NET Core)

查看:257
本文介绍了如何从UWP(又名.NET核心)Type对象获得大会的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Type类在.NET Framework中有一个Assembly属性。但是,当你编写一个当然使用.NET Core的UWP时,这个属性消失了。只有AssemblyQualifiedName属性可用。

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 AssemblyQualifiedName attribute is available.

如何从此名称进入大会?

How can I get to the Assembly from this name?

考虑到许多通常的类在.NET Core中不可用,所以您通常的.NET Framework答案可能不工作。例如。没有像AppDomain等这样的东西。

Please bear in mind that lot of the usual classes are not available in .NET Core, so your usual .NET Framework answer might not work. E.g. there is no such thing as AppDomain, etc.

推荐答案

确定我忽略了TypeInfo类是可用的GetTypeInfo类型目的。 TypeInfo获得了Assembly属性。

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

这篇关于如何从UWP(又名.NET核心)Type对象获得大会的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆