Skip to content

Instantly share code, notes, and snippets.

@joeybeninghove
Created February 24, 2025 03:43
Show Gist options
  • Save joeybeninghove/eb88b505482425231eb98d1ad34146f0 to your computer and use it in GitHub Desktop.
Save joeybeninghove/eb88b505482425231eb98d1ad34146f0 to your computer and use it in GitHub Desktop.
Quantower Post-Build Event (with ILRepack)
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<RunILRepack>true</RunILRepack>
</PropertyGroup>
<Target Name="ILRepacker" AfterTargets="Build" Condition="'$(RunILRepack)' == 'true'">
<ItemGroup>
<InputAssemblies Include="$(OutputPath)\<your-assembly>.dll"/>
<InputAssemblies Include="$(OutputPath)\<some-third-party-assembly>.dll"/>
<InputAssemblies Include="$(OutputPath)\<some-other-third-party-assembly>.dll"/>
</ItemGroup>
<ItemGroup>
<DoNotInternalizeAssemblies Include="$(AssemblyName)"/>
</ItemGroup>
<ILRepack
Parallel="true"
Internalize="true"
InputAssemblies="@(InputAssemblies)"
InternalizeExclude="@(DoNotInternalizeAssemblies)"
TargetKind="Dll"
OutputFile="$(OutputPath)\$(AssemblyName).dll"
/>
</Target>
</Project>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="CopyToQuantower" AfterTargets="ILRepacker" Condition="'$(Configuration)' == 'Release'">
<Copy SourceFiles="$(OutputPath)$(AssemblyName).dll" DestinationFolder="C:\Quantower\Settings\Scripts\Strategies"/>
</Target>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<!-- ... -->
<Import Project="Quantower.targets"/>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment