The build execution version of ILMerge'd is v4.0.20926; expected version v4.0.30319

This is what my .csproj AfterBuild looks like:

  <Target Name="AfterBuild" Condition=" '$(Configuration)' == 'Release'">
    <Exec Command="&quot;..\Tools\ILMerge\ILMerge.exe&quot; /internalize /ndebug /out:@(MainAssembly) /targetplatform:v4,C:\Windows\Microsoft.NET\Framework\v4.0.30319 &quot;@(IntermediateAssembly)&quot; @(ReferenceCopyLocalPaths->'&quot;%(FullPath)&quot;', ' ')" Condition=" '$(TargetFrameworkVersion)' == 'v4.0'" />
  </Target>

I am running 64 bit Windows. I tried changing the .NET Framework from ...\Microsoft.NET\Framework\...to ...\Microsoft.NET\Framework64\..., but that didn't help.

I also created ILMerge.exe.config in the ILMerge directory:

<?xml version ="1.0"?>
<configuration>
    <startup useLegacyV2RuntimeActivationPolicy="true">
        <requiredRuntime safemode="true" imageVersion="v4.0.30319" version="v4.0.30319"/>
    </startup>
</configuration>

Why doesn't ILMerge create assembly 4.0.30319?

+3
source share
2 answers

Edit: This problem was fixed in version v2.11.0502 released on May 2, 2011, so I removed the download link for my custom version.

ILMerge.exe(v2.10.0526), ​​ v4.0.30319, v4.0.20926. ILMerge.exe :

( , )

,

/targetplatform:v4,c:\Windows\Microsoft.NET\Framework\v4.0.30319

v4.0.30319. Reflector, . .

, ILMerge.exe.config, , ILMerge.exe .Net 4, , ILMerge.exe . Net 4. /targetplatform.

+5

!!

ILMerge v4 /targetplatform: v4 : .net .net v4 ( ).

, , , ( System.Func'2 Exception from) Linq Lambda.

, .

+1

Source: https://habr.com/ru/post/1745127/


All Articles