本文介绍了Assembly.LoadFrom()失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我希望能够通过从OpenFileDialog中选择一个dll来加载程序集。

这似乎有效,当它出现时汇编参考第三方dll的。


就这么简单:

Dim myAssembly As [Assembly] = [汇编] .LoadFile(FileName)


抛出以下异常:

System.Reflection.ReflectionTypeLoadException:一个或多个类型程序集无法加载。

在System.Reflection.Module.GetTypesInternal(StackCra wlMark& stackMark)

在System.Reflection.Assembly.GetTypes()

at Stegosoft.AssemblySniffer.Form1.ScanAssembly(strin g FileName)in ........


任何sugestions?


TIA,

Michael

解决方案




Hello,

I want to be able to load an assembly by selecting a dll from an OpenFileDialog.
This seems to work, exept when that assembly references "3rd-Party dll''s".

Just this simple line:

Dim myAssembly As [Assembly] = [Assembly].LoadFile(FileName)

throws the following exception:

System.Reflection.ReflectionTypeLoadException: One or more of the types in the assembly unable to load.
at System.Reflection.Module.GetTypesInternal(StackCra wlMark& stackMark)
at System.Reflection.Assembly.GetTypes()
at Stegosoft.AssemblySniffer.Form1.ScanAssembly(Strin g FileName) in ........

Any sugestions?

TIA,
Michael

解决方案




这篇关于Assembly.LoadFrom()失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 16:42