ILMerge icon indicating copy to clipboard operation
ILMerge copied to clipboard

Problem with .Net Core assemblies

Open tngraf opened this issue 6 years ago • 5 comments

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

tngraf avatar Apr 27 '18 14:04 tngraf

I think this is a duplicate of https://github.com/Microsoft/ILMerge/issues/11.

jnm2 avatar Apr 27 '18 15:04 jnm2

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?

DrPepperBianco avatar Jul 12 '19 13:07 DrPepperBianco

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.

DrPepperBianco avatar Jul 12 '19 13:07 DrPepperBianco

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).

mike-barnett avatar Jul 12 '19 15:07 mike-barnett

Have you tried /ndebug option to ILMerge?

jrobiso2471 avatar Mar 03 '20 19:03 jrobiso2471