【发布时间】:2009-06-15 19:28:46
【问题描述】:
我正在尝试使用 Assembly.Load() 加载 GAC 中的程序集。例如,假设我想列出 PresentationCore.dll 中存在的所有类型,我将如何加载 PresentationCore.dll?
当我尝试这个时:
Assembly a = Assembly.Load("PresentationCore.dll");
我收到 FileNotFoundException。 Another answer on SO 建议我使用 Assembly.LoadFrom() 来完成此操作 - 我很犹豫,因为根据 Visual Studio 2008,Assembly.LoadFrom() 已被弃用 - 另外,它似乎并没有实际工作。
有什么想法吗?
【问题讨论】: