Merge two assemblies at runtime - C#

强颜欢笑 提交于 2019-12-10 20:19:53

问题


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?

The why:

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?


回答1:


Take a look at ILMerge:

ILMerge is a utility for merging multiple .NET assemblies into a single .NET assembly.

Though it only runs in the v2.0 .NET runtime.



来源:https://stackoverflow.com/questions/3704699/merge-two-assemblies-at-runtime-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!