Why does Assembly.GetTypes() require references?

后端 未结 4 1941
[愿得一人]
[愿得一人] 2021-01-12 16:34

I want to get all of the types from my assembly, but I don\'t have the references, nor do I care about them. What does finding the interface types have to do with the refere

4条回答
  •  -上瘾入骨i
    2021-01-12 17:16

    In order to load the assembly, it's necessary to load the assembly's dependencies. If, for example, your assembly contains a type that returns an XmlNode then you will have to load System.Xml.dll

提交回复
热议问题