gluck / il-repack

Open-source alternative to ILMerge
Apache License 2.0
1.19k stars 217 forks source link

Method reference is used with definition return type / parameter. #298

Closed MeFisto94 closed 7 months ago

MeFisto94 commented 3 years ago
WARN: Method reference is used with definition return type / parameter. Indicates a likely invalid set of assemblies, consider one of the following
WARN:  - Remove the assembly defining Player from the merge
WARN:  - Add assembly defining Player Network_Player::get_PlayerScript() to the merge

So for some context: I want to patch certain types from an existing assembly, so I compile them using Roslyn and then use ILRepack to replace them, so far so good.

Just for paranoia reasons (and to allow the compiler to drop types), I annotate them in the base assembly with the Drop Attribute. Also the target assembly is the diff assembly, that only contains the changed types and then I add in the stripped base assembly.

I have to say that I don't fully understand the process yet, though it seems to work now. However ILRepack is issueing warnings for types that were implemented in the diff assembly but dropped from the base assembly, so that's why this warning appears I guess?

Would it be possible for ILRepack to search for all assemblies first before issuing this warning, or am I missing something? Thanks in Advance

KirillOsenkov commented 11 months ago

I have to confess that this issue is a bit fuzzy and nebulous. If you're still having a problem, ideally attach a zip file with a minimal set of small .dlls that shows how to reproduce the issue, as well as the exact command line passed to ILRepack.exe. Also mention the expected results and the actual results you're getting.

As of now I'm not sure how to investigate this further without the concrete dlls to debug. Thanks.

KirillOsenkov commented 7 months ago

Similar or same to #359

KirillOsenkov commented 7 months ago

I'm going to close because it's likely that you haven't correctly defined the proper set of input assemblies. There's a type being rewritten that is being used by an assembly that's not being rewritten.