I want to integrate ILRepack in my MSBuild pipeline for a .Net Core project to merge all required dlls into a single exe/dll.
The useful NuGet-Package ILRepack.MSBuild.Task
seems well fitted for that, however the example in the GitHub readme does not quite work for .Net Core projects and I can't figure out how I have to change this to be compatible with a .Net Core project:
<!-- ILRepack -->
<Target Name="AfterBuild" Condition="'$(Configuration)' == 'Release'">
<ItemGroup>
<InputAssemblies Include="$(OutputPath)\ExampleAssemblyToMerge1.dll" />
<InputAssemblies Include="$(OutputPath)\ExampleAssemblyToMerge2.dll" />
<InputAssemblies Include="$(OutputPath)\ExampleAssemblyToMerge3.dll" />
</ItemGroup>
<ItemGroup>
<!-- Must be a fully qualified name -->
<DoNotInternalizeAssemblies Include="ExampleAssemblyToMerge3" />
</ItemGroup>
<ILRepack
Parallel="true"
Internalize="true"
InternalizeExclude="@(DoNotInternalizeAssemblies)"
InputAssemblies="@(InputAssemblies)"
TargetKind="Dll"
OutputFile="$(OutputPath)\$(AssemblyName).dll"
/>
</Target>
<!-- /ILRepack -->
Clarification:
I just want to use the .csproj
-Format introduced with .Net-Core but actually using net461
as TargetPlatform
.