.NET:加载同一DLL的两个版本
发布时间:2020-12-13 20:28:33 所属栏目:Windows 来源:网络整理
导读:我需要加载同一DLL的两个版本,以便比较它们的输出.我假设我可以使用AppDomains,但我需要一些指导. 好吧,它实际上比我想象的容易得多. m_Assembly1 = Reflection.Assembly.LoadFile(IO.Path.Combine(System.Environment.CurrentDirectory,"Old VersionSome.d
我需要加载同一DLL的两个版本,以便比较它们的输出.我假设我可以使用AppDomains,但我需要一些指导.
好吧,它实际上比我想象的容易得多.
m_Assembly1 = Reflection.Assembly.LoadFile(IO.Path.Combine(System.Environment.CurrentDirectory,"Old VersionSome.dll")) m_Assembly2 = Reflection.Assembly.LoadFile(IO.Path.Combine(System.Environment.CurrentDirectory,"New VersionSome.dll")) Console.WriteLine("Old Version: " & m_Assembly1.GetName.Version.ToString) Console.WriteLine("New Version: " & m_Assembly2.GetName.Version.ToString) m_OldObject = m_Assembly1.CreateInstance("FullClassName") m_NewObject = m_Assembly2.CreateInstance("FullClassName") 从现在开始,我使用后期绑定和/或反射来运行我的测试. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 如何确定套接字是否已在Windows中处于非阻止模式?
- Windows重启时,MSMQueue可以保留其值吗?
- windows-server-2003 – 如何在不提示管理员密码的情况下从
- windows – 如何检查管理员是否已查看安全审核日志?
- windows-server-2003 – 在Windows中测试直接连接的数组
- windows – 用于连接到无线网络的命令行实用程序
- windows-server-2000 – 如何在Windows 2000服务器上生成Wi
- Nero8刻录引导系统光盘镜像图文教程
- 在Microsoft Excel中访问SQLite数据库的最佳方式是什么?
- Windows Server 2012 R2 VM备份失败,可用存储空间不足,无法
推荐文章
站长推荐
热点阅读