Giter Club home page Giter Club logo

Comments (7)

ravibpatel avatar ravibpatel commented on June 14, 2024

You can try providing ILRepack.targets similar to the following one in your projects folder.

<!-- ILRepack -->
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Target Name="ILRepacker" AfterTargets="Build" Condition="'$(Configuration)' == 'Release'">

    <ItemGroup>
        <InputAssemblies Include="$(OutputPath)\ExampleAssemblyToMerge1.dll" />
        <InputAssemblies Include="$(OutputPath)\ExampleAssemblyToMerge2.dll" />
        <InputAssemblies Include="$(OutputPath)\ExampleAssemblyToMerge3.dll" />
    </ItemGroup>

    <ILRepack
        Parallel="true"
        Internalize="true"
        InputAssemblies="@(InputAssemblies)"
        TargetKind="Dll"
        OutputFile="$(OutputPath)\$(AssemblyName).dll"
        AllowedDuplicateNamespaces="System.Collections.Generic.*"
    />

    </Target>
</Project>
<!-- /ILRepack -->

from ilrepack.lib.msbuild.task.

THHoekstra avatar THHoekstra commented on June 14, 2024

Thank you for your answer.
Does that mean I have to specify every assembly to include?
I was hoping for an option similar to /allowDup in "ILMerge"

from ilrepack.lib.msbuild.task.

ravibpatel avatar ravibpatel commented on June 14, 2024

Yes, You have to provide targets file to use AllowedDuplicateNamespaces option which should work similarly to /allowDup. You can use something like the following if you don't want to write every dll into the targets file.

<!-- ILRepack -->
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Target Name="ILRepacker" AfterTargets="Build" Condition="'$(Configuration)' == 'Release'">

    <ItemGroup>
      <InputAssemblies Include="$(OutputPath)$(TargetName)$(TargetExt)"/>
      <InputAssemblies Include="$(OutputPath)*.dll" Exclude="$(OutputPath)$(TargetName)$(TargetExt)"/>
    </ItemGroup>

    <ILRepack
      Parallel="true"
      DebugInfo="true"
      AllowDuplicateResources="false"
      InputAssemblies="@(InputAssemblies)"
      TargetKind="SameAsPrimaryAssembly"
      AllowedDuplicateNamespaces="System.Collections.Generic.*"
      OutputFile="$(OutputPath)$(TargetName)$(TargetExt)"
    />

    </Target>
</Project>
<!-- /ILRepack -->

from ilrepack.lib.msbuild.task.

THHoekstra avatar THHoekstra commented on June 14, 2024

Thanks again. That looks good. I will try this.

from ilrepack.lib.msbuild.task.

THHoekstra avatar THHoekstra commented on June 14, 2024

My build fails without any Error Message in the output.
How can I find out what's wrong with my targets file?

from ilrepack.lib.msbuild.task.

ravibpatel avatar ravibpatel commented on June 14, 2024

Try providing a LogFile option. It should show up in the log.

from ilrepack.lib.msbuild.task.

ravibpatel avatar ravibpatel commented on June 14, 2024

Or you can use MSBuild Log Viewer.

from ilrepack.lib.msbuild.task.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.