将程序集嵌入另一个程序集中 [英] Embedding assemblies inside another assembly

查看:138
本文介绍了将程序集嵌入另一个程序集中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您创建一个使用其他程序集中的东西的类库,是否可以将这些其他程序集作为某种资源嵌入到类库中?

If you create a class library that uses things from other assemblies, is it possible to embed those other assemblies inside the class library as some kind of resource?

而不是拥有 MyAssembly.dll SomeAssembly1.dll SomeAssembly2.dll 位于文件系统上,其他两个文件被捆绑到 MyAssembly.dll ,并在其代码中可用。

I.e. instead of having MyAssembly.dll, SomeAssembly1.dll and SomeAssembly2.dll sitting on the file system, those other two files get bundled in to MyAssembly.dll and are usable in its code.

我也有点困惑为什么.NET程序集是 .dll 文件。在.NET之前是否存在此格式?所有.NET程序集都是DLL,但不是所有的DLL都是.NET程序集?为什么他们使用相同的文件格式和/或文件扩展名?

I'm also a little confused about why .NET assemblies are .dll files. Didn't this format exist before .NET? Are all .NET assemblies DLLs, but not all DLLs are .NET assemblies? Why do they use the same file format and/or file extension?

推荐答案

看看 ILMerge for合并程序集。

Take a look at ILMerge for merging assemblies.


我也有点混淆.NET程序集为什么是.dll文件。在.NET之前是否存在此格式?

I'm also a little confused about why .NET assemblies are .dll files. Didn't this format exist before .NET?

是的。


NET组件DLL,

Are all .NET assemblies DLLs,

DLL或EXE通常 - 但也可以是netmodule。

Either DLLs or EXE normally - but can also be netmodule.


但不是所有的DLL都是.NET程序集?

but not all DLLs are .NET assemblies?

正确。


使用相同的文件格式和/或文件扩展名?

Why do they use the same file format and/or file extension?

为什么会有任何不同 - 它的用途相同!

Why should it be any different - it serves the same purpose!

这篇关于将程序集嵌入另一个程序集中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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