dotnet / ILMerge

ILMerge is a static linker for .NET Assemblies.
MIT License
1.23k stars 170 forks source link

Problem with .Net Core assemblies #43

Open tngraf opened 6 years ago

tngraf commented 6 years ago

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

jnm2 commented 6 years ago

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

DrPepperBianco commented 5 years ago

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 commented 5 years ago

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.

mike-barnett commented 5 years ago

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

jrobiso2471 commented 4 years ago

Have you tried /ndebug option to ILMerge?