Skip to content

fix: introduce a custom AssemblyResolver to resolve AssemblyResolutionException in Mono.Cecil #167

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

labbbirder
Copy link
Contributor

This should be the fix of the following issue:

When injecting [assembly:InternalsVisibleTo], the referenced assembly can not be resolved.

@handzlikchris
Copy link
Owner

thanks - I'll check it out.

Can't say I've seen this error - can you share how to repro?

@labbbirder
Copy link
Contributor Author

I retried to repro it, but the problem no longer occurs, even I recovered my workspace with git reset --hard to that point.

The issue first arose when I initially integrated FSR into my project. Every time I saved a file, the reload callback threw an AssemblyResolutionException (Cecil failed to resolve UniTask.dll during the assembly.Write operation inside CreateAssemblyWithInternalsContentsVisibleTo). This persisted until I made the changes described in this edition.

Upon reviewing the injection code, everything appears to be correct. There is no reason for Cecil to import UniTask for just importing a BCL attribute InternalsVisibleTo.

My project also includes other weaving and detouring tools, which may introduce the possibility of a race condition (the most likely I think).

This pull request can remain as a draft until anyother encouters with it, and I'll provide more information about it when I find something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants