【问题标题】:How get rid of 'System.Type' does not contain a definition for 'Assembly' error?如何摆脱“System.Type”不包含“Assembly”错误的定义?
【发布时间】:2014-11-28 10:52:37
【问题描述】:

我希望有人可以帮助我:由于使用了 System.Net.Http 包,我不再能够使用var assembly = GetType (MyClass).GetTypeInfo ().Assembly; 加载嵌入式资源。我认为这与 PCL 关联的配置文件“Profile78”有关,不是吗?你有什么办法解决这个问题吗?

提前感谢您的帮助! =)

【问题讨论】:

  • 是构建错误还是运行时错误?
  • 我是构建错误 ;)

标签: c# xamarin xamarin-studio


【解决方案1】:

根据 GetTypeInfo 是否为 IReflectableType 存在一些奇怪之处。此代码更改是否解决了问题而不引起其他问题?

Assembly assembly = typeof(MyClass).Assembly;

【讨论】:

    猜你喜欢
    • 2015-09-17
    • 2016-10-08
    • 1970-01-01
    • 2010-11-13
    • 2020-12-04
    • 2011-08-07
    • 1970-01-01
    • 1970-01-01
    • 2015-12-17
    相关资源
    最近更新 更多