Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assembly Resolution Validation #187

Open
TrevTV opened this issue Oct 25, 2024 · 1 comment
Open

Assembly Resolution Validation #187

TrevTV opened this issue Oct 25, 2024 · 1 comment
Labels
bug Something isn't working generation Related to assembly generation
Milestone

Comments

@TrevTV
Copy link

TrevTV commented Oct 25, 2024

ds5678 was notified of this on Discord, but I am making an issue as well.

There have been groups of games that seem to be throwing errors when generating assemblies from Pass81, more specifically, the call to UnstripTranslator.TranslateMethod. It seems like some things are not getting parsed correctly/fully leading to System.Collections.Generic.KeyNotFoundException: The given key 'X' was not present in the dictionary. errors occurring.

This was seen on standard Interop through MelonLoader.

Car Mechanic Simulator 2021 on MelonLoader v0.6.5
24-10-24_15-24-37.log

(no full log was provided) Pixel Worlds likely on MelonLoader v0.6.5 or v0.6.4, both use recent versions of Interop
image

On my fork of Interop for use with LemonLoader (Android support for ML), I also found a game that did something similar but not exactly the same. Instead of it failing to find a type, it would fail to find the entire Il2Cppmscorlib assembly here, even though it was generated. Note that the generator portion of Interop wasn't changed much by me, I basically only changed how xrefs were done.
This log isn't complete but shows the issue happening at the same pass, I was able to confirm that the line I linked was the problem code.
Latest.1.log

@ds5678 ds5678 added bug Something isn't working generation Related to assembly generation labels Dec 22, 2024
@ds5678
Copy link
Collaborator

ds5678 commented Dec 22, 2024

After many discussions in Discord, we have determined that this is a downstream issue caused by library users not properly setting the assembly resolvers on the assembly definitions they create. When running the CLI, which uses in-house assembly resolvers, the error does not occur.

Il2CppInterop should continue to not modify the assembly definitions provided to it, but it can provide validation against this issue.

@ds5678 ds5678 changed the title UnstripTranslator.TranslateMethod Failures Assembly Resolution Validation Dec 22, 2024
@ds5678 ds5678 added this to the 1.5.0 milestone Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working generation Related to assembly generation
Projects
None yet
Development

No branches or pull requests

2 participants