When does `Assembly.GetType(name)` return `null`?

后端 未结 6 1698
太阳男子
太阳男子 2021-01-12 17:47

I have a code like shown below

public static Type ToType(Type sType)
{    
    Assembly assembly = Assembly.Load(SerializableType.AssemblyName);
    type = a         


        
6条回答
  •  攒了一身酷
    2021-01-12 18:10

    Your type may be non public, by default reflection only works on public types and members, unless you increase your level of security, type will be null.

提交回复
热议问题