I am trying to create a federated version of FakeItEasy that includes Castle.Core. I read about ILMerge, and it seemed like this was the solution I needed. After downloading and creating FakeItEasy, I copied all the files I need (FakeItEasy.dll (.NET4), Castle.Core.dll (.NET4), ilmerge.exe, FakeItEasy.snk) to the same folder. Then I ran the following command:
ilmerge
/keyfile:FakeItEasy.snk
/out:..\FakeItEasy.dll
/t:library
/targetplatform:v4,C:\Windows\Microsoft.NET\Framework\v4.0.30319
FakeItEasy.dll Castle.Core.dll
And got the following result:
An exception occurred during merging:
An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at System.Compiler.Writer.MscorsnStrongNameSignatureGeneration(String wszFilePath, String wszKeyContainer, Byte[] pbKeyBlob, Int32 cbKeyBlob, IntPtr ppbSignatureBlob, IntPtr pcbSignatureBlob)
at System.Compiler.Writer.WritePE(String location, Boolean writeDebugSymbols, Module module, Boolean delaySign, String keyFileName, String keyName)
at System.Compiler.Writer.WritePE(CompilerParameters compilerParameters, Module module)
at ILMerging.ILMerge.Merge()
at ILMerging.ILMerge.Main(String[] args)
If I leave "/keyfile:FakeItEasy.snk", the combined assembly will be created just fine, but that will not help me, since I need a signed version.
I also tried to specify the target platform as:
/targetplatform:v4,C:\Windows\Microsoft.NET\Framework64\v4.0.30319
but the results were the same.
source
share