ravibpatel / ILRepack.Lib.MSBuild.Task

MSBuild task for ILRepack which is an open-source alternative to ILMerge.
Other
110 stars 31 forks source link

Repacking Harmony in Debug mode fails #49

Closed pardeike closed 6 months ago

pardeike commented 7 months ago

Hi,

my open source project Harmony uses this task to pack its "Fat" releases. It works fine but we discovered that the "DebugFat" release does not work on .NET 5 or newer. Packing itself isn't the problem because ReleaseFat works just fine.

The problem is very easy to replicate by cloning the project (master) and running tests for DebugFat and ReleaseFat.

There is an active discussion going on on my discord server where the guys from the MonoMod.Core project (a dependency Harmony has) discuss that this is related to them using some function pointer here which matches the exception I get when running/testing DebugFat:

System.TypeLoadException : Could not load type 'CORINFO_METHOD_INFO' from assembly 'System.Runtime.Serialization.Formatters, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

which is also randomly giving other assemblies (so not related to System.Runtime.Serialization.Formatters at all).

Quote from @nike4613 in the discord:

If you want to discuss this issue, you are welcome to temporarily join my discord server. The channel is called harmony-contributors.

ravibpatel commented 6 months ago

Please open the issue here, as it uses ILRepack under the hood. @KirillOsenkov will be able to help you out better in this case.

pardeike commented 6 months ago

Created: https://github.com/gluck/il-repack/issues/355

KirillOsenkov commented 6 months ago

Hi, big fan of Harmony. Very busy week but I'll try to get to it this weekend.

pardeike commented 6 months ago

No worries. Glad you respond so fast ☺️

KirillOsenkov commented 6 months ago

The upstream bug is fixed in 2.0.29: https://github.com/gluck/il-repack/issues/355

https://www.nuget.org/packages/ILRepack/2.0.29

Here's the PR to update ILRepack.Lib.MSBuild.Task to 2.0.29: https://github.com/ravibpatel/ILRepack.Lib.MSBuild.Task/pull/50

KirillOsenkov commented 6 months ago

After this is merged and published, we can bump Harmony to 2.0.29 and validate the fix.

ravibpatel commented 6 months ago

Merged and published. Thanks for fixing it so fast.

pardeike commented 6 months ago

works like a charm