.NET assemblies that contain a mixture of managed and unmanaged code cannot be ILMerged with other assemblies.
How can I verify if a given .NET assembly contains purely managed code, or a mix of managed and unmanaged code?
As suggested by nobugz, an easier way to see the CLR Flags is using the corflags
utility, which is part of the .NET 2.0 SDK.
If no options are specified, the flags for the given image are displayed:
C:\>corflags Foo.dll
Version : v2.0.50727
CLR Header: 2.5
PE : PE32
CorFlags : 9
ILONLY : 1
32BIT : 0
Signed : 1
The "ILONLY" bit indicates whether this is a pure managed assemby, or a mixed assembly.
Note that the comment from user 'nobugz' suggests these flags are not guaranteed to be correct, so this method may not be foolproof.
Run the PEVerify tool against your assembly.
PEVerify.exe is installed along with Visual Studio, e.g. this one comes with Visual Studio 2012:
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\PEVerify.exe
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With