ILMerge
ILMerge copied to clipboard
Problem with .Net Core assemblies
Hello,
I tried to merge several .Net Core assemblies together. Whereas this work fine for Microsoft assemblies like for example System.Collections.dll, it fails for my own .Net Core assemblies:
ilmerge /log:ilmerge.log /out:CMD.exe CLI.exe Tethys.Logging.dll
Error message:
Trying to read assembly from the file 'D:\Software\SWC\sw360clients\SW360CLI_C#\SW360CLI\bin\Release\Tethys.Logging.dll'.
Successfully read in assembly.
There were errors reported in Tethys.Logging's metadata.
Die Arraydimensionen haben den unterstützten Bereich überschritten.
An exception occurred during merging:
ILMerge.Merge: There were errors reported in Tethys.Logging's metadata.
Die Arraydimensionen haben den unterstützten Bereich überschritten.
bei ILMerging.ILMerge.Merge()
bei ILMerging.ILMerge.Main(String[] args)
German 'Die Arraydimensionen haben den unterstützten Bereich überschritten.' stands for ...the array dimensions have exceeded the supported range ...
Tethys.Logging, version 1.4.2, is available on NuGet: https://www.nuget.org/packages/Tethys.Logging/1.4.2
Any ideas?
Thanks,
Thomas
I think this is a duplicate of https://github.com/Microsoft/ILMerge/issues/11.
I think this is a duplicate of #11.
So, then the answer would be to add "<DebugType>Full</DebugType>" to all projects? [At least all projects, whose assemblies should be merged.] – Did I understand this correctly?
Alternative, It also worked, when you delete all PDBs from the folder before merging the DLLs. – I wonder, if there is a downside to this? I assume a merged pdb is generated for debugging purposes. If I delete problematic PDBs before the merge, this information are then probably missing from the generated PDB.
Yes, ILMerge merges the PDB files too, but is unable to deal with the new portable PDB format. So you would have to either generate an old-style PDB or else remove it (but then, as you note, there will be no debugging info for code from the corresponding assembly).
Have you tried /ndebug option to ILMerge?