本文介绍了如何将ILMerge集成到Visual Studio生成过程中以合并程序集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将一个.NET DLL程序集和一个由VB.NET控制台应用程序项目引用的C#类库项目合并到一个命令行控制台可执行文件中.

I want to merge one .NET DLL assembly and one C# Class Library project referenced by a VB.NET Console Application project into one command-line console executable.

我可以从命令行使用ILMerge做到这一点,但是我想将参考程序集和项目的这种合并集成到Visual Studio项目中.从我的阅读中,我了解我可以通过MSBuild任务或Target来完成此任务,只需将其添加到C#/VB.NET Project文件中,但是由于MSBuild是一个大型主题,因此找不到具体的示例.此外,我找到了一些将ILMerge命令添加到Post-build事件中的引用.

I can do this with ILMerge from the command-line, but I want to integrate this merging of reference assemblies and projects into the Visual Studio project. From my reading, I understand that I can do this through a MSBuild Task or a Target and just add it to a C#/VB.NET Project file, but I can find no specific example since MSBuild is large topic. Moreover, I find some references that add the ILMerge command to the Post-build event.

  1. 如何将ILMerge集成到只是MSBuild项目的Visual Studio(C#/VB.NET)项目中,以将所有引用的程序集(copy-local = true)合并到一个程序集中?

  1. How do I integrate ILMerge into a Visual Studio (C#/VB.NET) project, which are just MSBuild projects, to merge all referenced assemblies (copy-local=true) into one assembly?

这如何绑定到可能的ILMerge.Targets文件?

How does this tie into a possible ILMerge.Targets file?

使用构建后事件更好吗?

Is it better to use the Post-build event?

推荐答案

在在Visual Studio中的单个程序集中混合语言与ILMerge和MSBuild无缝集成 www.hanselman.com/blog/MixingLanguagesInASingleAssemblyInVisualStudioSeamlesslyWithILMergeAndMSBuild.aspx"rel =" noreferrer> http://www.hanselman.com/blog/MixingLanguagesInASingleAssemblyInVisualStudioSeamlesslyWithILMergeAndMLBuildAndMSBuild.aspx .

The article Mixing Languages in a Single Assembly in Visual Studio seamlessly with ILMerge and MSBuild at http://www.hanselman.com/blog/MixingLanguagesInASingleAssemblyInVisualStudioSeamlesslyWithILMergeAndMSBuild.aspx demonstrates how to use ILMerge and MSBuild within a Visual Studio Project.

这篇关于如何将ILMerge集成到Visual Studio生成过程中以合并程序集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-09 05:08