這是我的.csproj AfterBuild樣子:ILMerge'd程序集的運行時版本爲v4.0.20926;預期的版本是v4.0.30319
<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>
我運行64位Windows。我曾嘗試將.NET Framework從...\Microsoft.NET\Framework\...
更改爲...\Microsoft.NET\Framework64\...
,但它沒有幫助。
我還創建ILMerge.exe.config在ILMerge目錄:
<?xml version ="1.0"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<requiredRuntime safemode="true" imageVersion="v4.0.30319" version="v4.0.30319"/>
</startup>
</configuration>
爲什麼不ILMerge生成4.0.30319大會?
您正在使用什麼版本的ilmerge? – Will 2010-07-14 17:06:34
我嘗試了更新(因爲這個問題被問到)版本於5月26日發佈,2.10.0526,但我仍然有同樣的問題。 – 2010-07-14 19:19:02
這似乎是ILMerge中的一個錯誤,它生成.Net 4.0 Beta2的運行時版本。我知道這真的沒有幫助,但你可以聯繫微軟的Mike Barnett(他的電子郵件在ILMerge下載頁面) 對不起 – CriGoT 2010-07-15 19:05:57