How Type.GetType works when given partially qualified type name?

前端 未结 5 930
谎友^
谎友^ 2020-11-30 13:50

In numerous places do I encounter partially qualified type names of the form FullTypeName, AssemblyName, i.e. like Type.AssemblyQualifiedName only

5条回答
  •  遥遥无期
    2020-11-30 14:24

    If the DLL it's in isn't already loaded into the application domain (e.g. you used it), you need the full path like this, if it's already loaded, it can find it with the shorter version.

    To answer your question: the second version always works, stick with it and you have one way to worry about.

提交回复
热议问题