Runtime Version of ILMerge'd assembly is v4.0.20926; expected version is v4.0.30319
- by Sam
This is what my .csproj AfterBuild looks like:
<Target Name="AfterBuild" Condition=" '$(Configuration)' == 'Release'">
<Exec Command=""..\Tools\ILMerge\ILMerge.exe" /internalize /ndebug /out:@(MainAssembly) /targetplatform:v4,C:\Windows\Microsoft.NET\Framework\v4.0.30319 "@(IntermediateAssembly)" @(ReferenceCopyLocalPaths->'"%(FullPath)"', ' ')" Condition=" '$(TargetFrameworkVersion)' == 'v4.0'" />
</Target>
I'm running 64-bit Windows. I have tried changing the .NET Framework from ...\Microsoft.NET\Framework\... to ...\Microsoft.NET\Framework64\... but it 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 isn't ILMerge generating a 4.0.30319 assembly?