在运行时合并两个程序集-C# [英] Merge two assemblies at runtime - C#

查看:133
本文介绍了在运行时合并两个程序集-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?

推荐答案

看看

ILMerge是用于将多个.NET程序集合并到单个.NET程序集中的实用程序.

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

尽管它只能在v2.0 .NET运行时中运行.

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

这篇关于在运行时合并两个程序集-C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆