Type.GetType(“namespace.a.b.ClassName”) returns null

前端 未结 16 1364
旧巷少年郎
旧巷少年郎 2020-11-22 02:58

This code:

Type.GetType(\"namespace.a.b.ClassName\")

returns null.

and I have in the usings:

using nam         


        
16条回答
  •  梦毁少年i
    2020-11-22 03:43

    If the assembly is part of the build of an ASP.NET application, you can use the BuildManager class:

    using System.Web.Compilation
    ...
    BuildManager.GetType(typeName, false);
    

提交回复
热议问题