FastScriptReload
FastScriptReload copied to clipboard
fix: introduce a custom AssemblyResolver to resolve AssemblyResolutionException in Mono.Cecil
This should be the fix of the following issue:
When injecting [assembly:InternalsVisibleTo], the referenced assembly can not be resolved.
thanks - I'll check it out.
Can't say I've seen this error - can you share how to repro?
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.
I just encountered this same issue in my project, I think it might have something to do with FishNet as I've looked through their discord server and found a few other people reporting the same problem, although from an older version.
Here is the log, not sure if it'll help or not.
Going to just uninstall FSR temporarily and wait for a fix, but I will make a full copy of my project before I do that.