BuildManager.GetReferencedAssemblies equivalent for non-web applications

前端 未结 3 1162
鱼传尺愫
鱼传尺愫 2021-02-07 12:26

Compared to AppDomain.GetAssemblies(), BuildManager.GetReferencedAssemblies() (System.Web.Compilation.BuildManager) seems a more reliable way to get th

3条回答
  •  醉酒成梦
    2021-02-07 12:40

    I've had the same problem. And after doing some research I've still not found a solid answer. The best I've come up with is to combine AppDomain.CurrentDomain.GetAssemblies() with the AppDomain.AssemblyLoad event.

    In that way I can process all already loaded assemblies while getting notified for all new assemblies (which I then scan).

提交回复
热议问题