title: How do I use ILMerge with .NET 4.5 in AfterBuild?
body: <p>We want to upgrade our solution with several projects to .NET 4.5. We already use Visual Studio 2012. We use ILMerge to merge the assemblies to a single EXE. </p>
  
  <p>Our current .csproj file for the main project look like this:</p>
  
  <pre><code>&lt;Target Name="AfterBuild" Condition=" '$(Configuration)' == 'Release' "&gt;
      &lt;CreateItem Include="@(ReferenceCopyLocalPaths)" Condition="'%(Extension)'=='.dll'"&gt;
          &lt;Output ItemName="AssembliesToMerge" TaskParameter="Include" /&gt;
      &lt;/CreateItem&gt;
      &lt;PropertyGroup&gt;
          &lt;ReferenceAssemblies&gt;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0&lt;/ReferenceAssemblies&gt;
      &lt;/PropertyGroup&gt;
      &lt;Message Importance="high" Text="Executing ILMerge...with target platform from $(ReferenceAssemblies)" /&gt;
      &lt;Exec Command="&amp;quot;$(SolutionDir)LIB\ILMerge.exe&amp;quot; /out:@(MainAssembly) /internalize /targetplatform:v4,&amp;quot;$(ReferenceAssemblies)&amp;quot; &amp;quot;@(IntermediateAssembly)&amp;quot; @(AssembliesToMerge-&gt;'&amp;quot;%(FullPath)&amp;quot;', ' ')" /&gt;
      &lt;Delete Files="@(ReferenceCopyLocalPaths-&gt;'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')" /&gt;
  &lt;/Target&gt;
  </code></pre>
  
  <p>How should this look for .NET 4.5?</p>
  
  <p>I've read <a href="http://www.mattwrock.com/post/2012/02/29/What-you-should-know-about-running-ILMerge-on-Net-45-Beta-assemblies-targeting-Net-40.aspx">here</a> that there are some issues using ILMerge with .NET 4.5.</p>