0
votes

I have an issue with ILMerge, latest release 2.12.0803. Even my assemblies have processor architecture set to MSIL, the output merged assembly has x86.

The way I run ILMerge is:

ILMerge.exe /t:library /targetPlatform="v4,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0" /keyfile:key.snk /output:"Test.dll" a.dll b.dll ... other assemblies

On build time I have a warning:

There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "Test", "x86"

and at run-time I get a File Not found Exception:

Could not load file or assembly 'Test, Version=3.9.32.0, Culture=neutral, PublicKeyToken=8fd4d0b13dde34b0' or one of its dependencies. The system cannot find the file specified.

Running gacutil:

C:\Windows\system32>gacutil /l "Test, Version=3.9.32.0, Culture=neutral, PublicKeyToken=8fd4d0b13dde34b0" Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.17929 Copyright (c) Microsoft Corporation. All rights reserved.

The Global Assembly Cache contains the following assemblies: Test, Version=3.9.32.0, Culture=neutral, PublicKeyTok en=8fd4d0b13dde34b0, processorArchitecture=x86

Is there a way to change the processorArchitecture to MSIL for the merged assembly?

1
MSIL isn't a processor architecture, is it? - simon at rcl
this is what gacutil outputs:The Global Assembly Cache contains the following assemblies: Test, Version=3.9.32.0, Culture=neutral, PublicKeyToken=8fd4d0b13dde34b0, processorArchitecture=MSIL. So, is it?..I was clearly referring to the parameter name.. - Bogdan M.

1 Answers

0
votes

I solved the issue. The problem was that one of the assemblies requires 32 bits, see ServiceStack.Redis.

From ILMerge log file:

Checking to see that all of the input assemblies have a compatible PeKind.

ServiceStack.PeKind = ILonly
ServiceStack.Interfaces.PeKind = ILonly
ServiceStack.Common.PeKind = ILonly
ServiceStack.OrmLite.PeKind = ILonly
ServiceStack.Redis.PeKind = ILonly, Requires32bits
ServiceStack.ServiceInterface.PeKind = ILonly
ServiceStack.Text.PeKind = ILonly
log4net.PeKind = ILonly