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

后端 未结 6 1700
太阳男子
太阳男子 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:04

    I struggled to find the correctly qualified name of a type in a dll I was trying to use, but found GetTypes() really useful in listing all available. In VB:

        Dim t As Type() = assem.GetTypes()
        Dim s As String = ""
        For i As Integer = 0 To t.Length - 1
            s = s & t(i).FullName & vbCrLf
        Next i
        MsgBox(s)
    

提交回复
热议问题