- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想使我的组件/组件与源代码清晰地分开,但在某些情况下(可能与扩展无关),我也需要将它们打包在同一个dll中。
是否可以在单个dll中打包多个.NET程序集?如果是这样,如何?
如果可能,您认为这是个好主意吗?为什么?
任何帮助表示赞赏!
最佳答案
看看这篇文章:Merging .NET assemblies using ILMerge
As you know, traditional linking of object code is no longer necessary in .NET. A .NET program will usually consist of multiple parts. A typical .NET application consists of an executable assembly, a few assemblies in the program directory, and a few assemblies in the global assembly cache. When the program is run, the runtime combines all these parts to a program. Linking at compile time is no longer necessary.
But sometimes, it is nevertheless useful to combine all parts a program needs to execute into a single assembly. For example, you might want to simplify the deployment of your application by combining the program, all required libraries, and all resources, into a single .exe file.
csc /target:library /out:ClassLibrary1.dll ClassLibrary1.cs
vbc /target:library /out:ClassLibrary2.dll ClassLibrary2.vb
vbc /target:winexe /out:Program.exe
/reference:ClassLibrary1.dll,ClassLibrary2.dll Program.vb
ilmerge /target:winexe /out:SelfContainedProgram.exe
Program.exe ClassLibrary1.dll ClassLibrary2.dll
关于.net - 有没有办法在一个dll中打包多个.NET程序集?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1340136/
我是一名优秀的程序员,十分优秀!