从多个项目单一组装 [英] Single assembly from multiple projects

查看:138
本文介绍了从多个项目单一组装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在涉及几个项目在一个解决方案.NET应用程序中,我有一个命名空间设置为Company.Product.UI和另一个Company.Product.UI.WebPages的项目。我的问题是两个DLL从建设两个项目的结果。怎样才可以有一个DLL,仍然preserve当前的解决方案结构。我使用Visual Studio 2008和C#。

In a .net application involving several projects in one solution, I have a project with the namespace set to Company.Product.UI and another one with Company.Product.UI.WebPages. My problem is that two dlls result from building the two projects. How can I have a single dll and still preserve the current solution structure. I use Visual Studio 2008 and C#.

推荐答案

您必须要么合并这两个项目成一个项目或使用类似的 ILMerge 所得到的组件合并成一个单一的组件。

You will have to either merge the two projects into one project or use a tool like ILMerge to merge the resulting assemblies into a single assembly.

ILMerge是可以使用的一个实用   合并多个.NET程序集成   一个单一的组件。它是自由   可以从工具与使用;   在微软.NET工具页面   Framework开发中心。

ILMerge is a utility that can be used to merge multiple .NET assemblies into a single assembly. It is freely available for use from the Tools & Utilities page at the Microsoft .NET Framework Developer Center.

如果您想自动ILMerge作为一个MSBuild任务,那么我建议你看一看 ilmerge-任务的:

If you want to automate ILMerge as an MSBuild task then I would suggest you take a look at ilmerge-tasks:

有兴趣的过程中使用ILMerge   自动构建? ILMerge任务   containts 2可建的项目,   将允许您访问ILMerge作为   工作距离的MSBuild和楠。它   甚至还包括一个生成后事件   合并ILMerge和任务的DLL,以便   您可以使用任务,而不   ILMerge.exe是present。

Interested in using ILMerge during an automated build? ILMerge Tasks containts two buildable projects that will allow you to access ILMerge as a task from both MSBuild and NAnt. It even includes a post-build event that merges ILMerge and the task dll so that you can use the task without ILMerge.exe being present.

这篇关于从多个项目单一组装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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