Assembly的LoadFile()和LoadFrom()的区别
2006-07-30 22:04
507 查看
Use the LoadFile method to load and examine assemblies that have the same identity, but are located in different paths. Do not use LoadFile to load assemblies that you want to execute.
LoadFile does not load files into the LoadFrom context, and does not resolve dependencies using the load path, as the LoadFrom method does. LoadFile is useful in this limited scenario because LoadFrom cannot be used to load assemblies that have the same identities but different paths; it will load only the first such assembly.
即不同物理位置的相同程序集通过LoadFile加载后,实例化其中的对象后不能进行类型比较,因为没有相同的环境。所以在类似插件系统的程序集动态加载的实现中应该使用LoadFrom方法(btw:调用后不会自动加载依赖的程序集)。
http://www.cnblogs.com/kozen
LoadFile does not load files into the LoadFrom context, and does not resolve dependencies using the load path, as the LoadFrom method does. LoadFile is useful in this limited scenario because LoadFrom cannot be used to load assemblies that have the same identities but different paths; it will load only the first such assembly.
即不同物理位置的相同程序集通过LoadFile加载后,实例化其中的对象后不能进行类型比较,因为没有相同的环境。所以在类似插件系统的程序集动态加载的实现中应该使用LoadFrom方法(btw:调用后不会自动加载依赖的程序集)。
http://www.cnblogs.com/kozen
相关文章推荐
- Assembly的LoadFile()和LoadFrom()的区别
- Assembly中Load, LoadFrom, LoadFile以及AppDomain, Activator类中相应函数的区别
- Assembly中Load, LoadFrom, LoadFile以及AppDomain, Activator类中相应函数的区别
- Assembly的LoadFile()和LoadFrom()的区别
- Assembly.LoadFrom()和Assembly.LoadFile()的区别
- Assembly.Load()方法,Assembly.LoadFrom()方法,Assembly.LoadFile()方法的区别!
- Assembly.LoadFile 与 Assembly.LoadFrom的区别
- Assembly的load, loadfrom, loadfile方法总结
- Assembly的load, loadfrom, loadfile方法总结
- Assembly.Load,LoadFile,LoadFrom
- Assembly.Load()方法,Assembly.LoadFrom()方法,Assembly.LoadFile()方法的区别!
- Could not load file or assembly 'ESRI.ArcGIS.SOESupport, Version=10.1.0.0, Culture=neutral, PublicKe
- 错误处理:"Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was
- Could not load file or assembly 'xxx' or one of its dependencies.
- C#反射之Assembly.Load,Assembly.LoadFile 与 Assembly.LoadFrom方法介绍
- Could not load file or assembly or one of its dependencies. 试图加载格式不正确的程序。
- VS2013连接sql2008的问题-Could not load file or assembly 'Microsoft.SqlServer.Manageme
- Could not load file or assembly ‘Microsoft.VisualStudio.Tools.Applications.Core’
- 调用Powershell相关类库的版本问题:Could not load file or assembly System.Management.Automation, Version=3.0.0.0
- Could not load file or assembly "\win32_x86\dotnet1\crdb_adoplus.dll' or one of its dependencies.