Skip to content

Instantly share code, notes, and snippets.

@Eun
Created November 16, 2016 10:02
Show Gist options
  • Save Eun/aecee1cebd463199023b4793c5c98566 to your computer and use it in GitHub Desktop.
Save Eun/aecee1cebd463199023b4793c5c98566 to your computer and use it in GitHub Desktop.
ILMerge AfterBuild
<Target Name="AfterBuild" Condition="'$(Configuration)'=='Release'">
<CreateItem Include="$(SolutionDir)\packages\ILMerge.*\tools\ILMerge.exe">
<Output TaskParameter="Include" ItemName="ILMergeExe" />
</CreateItem>
<Error Text="@(ILMergeExe) does not exists" Condition="!Exists('@(ILMergeExe)')" />
<CreateItem Include="@(ReferencePath)" Condition="'%(CopyLocal)'=='true'">
<Output TaskParameter="Include" ItemName="ILMergeAssemblies" />
</CreateItem>
<Delete Files="$(OutputPath)\ILMerge.log" Condition="Exists('$(OutputPath)\ILMerge.log')" />
<Exec Command="&quot;@(ILMergeExe)&quot; /ndebug /log:$(OutputPath)\ILMerge.log /out:@(MainAssembly) &quot;@(IntermediateAssembly)&quot; @(ILMergeAssemblies-&gt;'&quot;%(FullPath)&quot;', ' ')" />
</Target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment