ILMerge问题问题、ILMerge

由网友(樱花祭.)分享简介:我试图将多个组件插入一个作为我的'代理'组件WCF服务。目前,该代理的用户需要引用的程序集包含数据的合同,也是我的域装配,因为我的产业计划。我想使用ILMerge这一点。特别是,ILMerge任务的项目看起来很有希望,特别是这条线从他们的项目主页: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/>
< /目标>
 
C 中用ILMerge将所有引用的DLL和exe文件打成一个exe文件,有图解

但现在我得到以下错误:

  

未找到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:WindowsMicrosoft.NETFrameworkv4.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

阅读全文

相关推荐

最新文章