在运行时合并两个程序集-C# [英] Merge two assemblies at runtime - C#
问题描述
是否可以在运行时合并两个程序集,以便当您遍历ExportedTypes时,返回两个原始程序集的所有类型?
Is it possible to merge two assemblies at runtime such that, when you iterate over the ExportedTypes, all the types from both original assemblies are returned?
原因:
我使用数据库迁移框架来更新数据库.它需要一个由特殊类组成的程序集,这些类定义了对数据库所做的修改.
I use a database migration framework to update my databases. It take a single assembly made up of special classes which defines the modifications made to the database.
我有两个非常相似的数据库.许多表是相同的,但每个表都有几个唯一的表.我希望每个数据库都有一个通用的迁移程序集和一个特定的程序集.但是要在我的框架中使用它,我需要将两个程序集填充到一个程序集中. 这可能吗?
I have two databases the are very similar. Many tables are identical, but each has a couple of unique tables. I would like to have a general migration assembly and a specific assembly for each database. But to use it with my framework, I need to stuff the two assemblies into a single one. Is this possible?