本文介绍了ILMerge问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将多个组件插入一个作为我的'代理'组件WCF服务。目前,该代理的用户需要引用的程序集包含数据的合同,也是我的域装配,因为我的产业计划。

我想使用ILMerge这一点。特别是,ILMerge任务的项目看起来很有希望,特别是这条线从他们的项目主页:

ILMerge任务项目主页:

这是precisely什么,我想做到,但我真的不知道如何去做。请帮帮忙!

其他相关的(也许是)信息:

  • 我们使用的是自动生成TFS中,所以没有的 ilmerge.exe 的present将是一大利好

更新:

所以,我包括ILMerge.MSBUild.Tasks.dll在我的项目,并增加了以下到我的生成文件(取自ilmerge项目主页):

 <目标名称=AfterBuild>

    < UsingTask TASKNAME =ILMerge.MSBuild.Tasks.ILMerge
        AssemblyFile =ILMerge.MSBuild.Tasks.ILMerge/>
    < ItemGroup>
       < MergeAsm包括=BarProject.dll/>
       < MergeAsm包括=FooProject.dll/>
    < / ItemGroup>

    < ILMerge InputAssemblies =@(MergeAsm)OUTPUTFILE =FooBar.dll/>
< /目标>
 

但现在我得到以下错误:

解决方案

解决了。

  • 在我做的不可以使用上述
  • 配置
  • 在我做的不可以使用ILMerge.MSBuild.Tasks.dll

下面是我采取的步骤:

  • 添加引用为 ILMerge.exe (该从的)到我的项目
  • 添加了这个PostBuild进入到我的MSBuild文件(.csproj的):

        ILMerge /out:FooBar.dll Bar.dll Foo.dll

I'm trying to merge multiple assemblies into one as my 'Proxy' assembly for a WCF service. Currently, users of the Proxy need to reference the assembly containing the data contracts, and also my domain assembly because of my inheritance schemes.

I'd like to use ILMerge for this. In particular, the ILMerge-Tasks project looks promising, especially this line from their project home:

ILMerge-Tasks Project Home:

This is precisely what i'd like to accomplish, but i really have no idea how to go about it. Please help!

Other relevant (perhaps) info:

  • We are using automated builds in TFS, so not having ilmerge.exe present will be a big plus

Update:

So I included the ILMerge.MSBUild.Tasks.dll in my project and added the following to my build file (taken from ilmerge project home):

<Target Name="AfterBuild">

    <UsingTask TaskName="ILMerge.MSBuild.Tasks.ILMerge" 
        AssemblyFile="ILMerge.MSBuild.Tasks.ILMerge"/>
    <ItemGroup>
       <MergeAsm Include="BarProject.dll" />
       <MergeAsm Include="FooProject.dll" />
    </ItemGroup>

    <ILMerge InputAssemblies="@(MergeAsm)" OutputFile="FooBar.dll" />
</Target>

But now I get the following error:

解决方案

Solved.

  • I did NOT use the configuration above
  • I did NOT use the ILMerge.MSBuild.Tasks.dll

Here's the steps I took:

  • Added a reference to ILMerge.exe (the one from Microsoft Research) to my project
  • Added this PostBuild entry to my MSBuild file (.csproj):

    ILMerge /out:FooBar.dll Bar.dll Foo.dll

这篇关于ILMerge问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 01:12