[英]Merge projects in solution into a single project?
I have a solution with a few projects. 我有一些项目的解决方案。 How I can merge all projects into a single project? 如何将所有项目合并到一个项目中? I want to just compile my solution and get single file application at the output. 我想编译我的解决方案并在输出中获取单个文件应用程序。
Note: this question has been edited for clarity. 注意:为清楚起见,此问题已经过编辑。 Originally it was confusing and seemed to imply that it was looking for information on merging already-compiled assemblies. 最初它令人困惑,似乎暗示它正在寻找合并已经编译的程序集的信息。
我想你正在寻找ILMerge 。
(Answer based on old interpretation of question) (基于旧问题解释的答案)
I am assuming you want to merge all of the resulting assemblies into a single one, and not the projects in to a single solution. 我假设您要将所有生成的程序集合并为一个,而不是将项目合并到单个解决方案中。
If that is the case, use ILMerge . 如果是这种情况,请使用ILMerge 。
From the site: 从网站:
ILMerge is a utility for merging multiple .NET assemblies into a single .NET assembly. ILMerge是一个用于将多个.NET程序集合并到单个.NET程序集中的实用程序。 It works on executables and DLLs alike and comes with several options for controlling the processing and format of the output. 它适用于可执行文件和DLL,并带有几个选项来控制输出的处理和格式。 See the accompanying documentation for details. 有关详细信息,请参阅随附文档
This is not the only tool - you can also use Mono.Merge
for the same functionality. 这不是唯一的工具 - 您也可以使用Mono.Merge
获得相同的功能。
You want to merge the projects, not just the assemblies? 您想合并项目,而不仅仅是程序集?
I don't know any automated process, but I think you'll want to do something like: 我不知道任何自动化过程,但我认为你会想做类似的事情:
Does every file in each project use its own namespace? 每个项目中的每个文件都使用自己的命名空间吗? If so, the above is all you have to do that I can think of. 如果是这样,以上就是我能想到的所有事情。 Otherwise, you'll want to make it so, recompile, and retest before trying to merge the projects into one. 否则,在尝试将项目合并为一个项目之前,您需要这样做,重新编译并重新测试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.