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

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

问题描述

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

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.dllSomeAssembly1.dllSomeAssembly2.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 用于合并程序集.

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 - 但也可以是网络模块.

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天全站免登陆