ILMerge问题 [英] ILMerge question

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

问题描述

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

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

ILMerge任务项目主页:

  

......它甚至还包括一个生成后事件,合并ILMerge和任务的DLL,以便您可以使用任务没有ILMerge.exe是present。

这是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/>
< /目标>
 

但现在我得到以下错误:

  

未找到UsingTask的任务。检查以下内容:1)在项目文件中的任务的名称是一样的任务类的名称。 2)任务类是公,实现了Microsoft.Build.Framework.ITask接口。 3)任务是正确地在项目文件中声明,或在* .tasks位于文件C:\ WINDOWS \ Microsoft.NET \框架\ v4.0.30319目录

解决方案

解决了。

  • 在我做的不可以使用上述
  • 配置
  • 在我做的不可以使用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:

...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.

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:

The "UsingTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with in the project file, or in the *.tasks files located in the "C:\Windows\Microsoft.NET\Framework\v4.0.30319" directory.

解决方案

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问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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